[PATCH] D103225: [AMDGPU] Replace non-kernel function uses of LDS globals by pointers.

Jon Chesterfield via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 25 16:31:23 PDT 2021


JonChesterfield added a comment.

those clone instructions will yield a bunch of code, including some makefile machinery and the following C:

  // helloworld.c
  #include <stdio.h>
  #include <omp.h>
  
  int main(void) {
    int isHost = 1;
  
  #pragma omp target map(tofrom: isHost)
    {
      isHost = omp_is_initial_device();
      printf("Hello world. %d\n", 100);
      for (int i =0; i<5; i++) {
        printf("Hello world. iteration %d\n", i);
      }
    }
  
    printf("Target region executed on the %s\n", isHost ? "host" : "device");
  
    return isHost;
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103225/new/

https://reviews.llvm.org/D103225



More information about the llvm-commits mailing list