Created
January 17, 2023 23:17
-
-
Save cgmb/09200700df3bd6122e33df5794df7e12 to your computer and use it in GitHub Desktop.
Clang offload bundle example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/opt/rocm/llvm/bin/clang++ --offload-arch=gfx906:xnack- -L/opt/rocm/hip/lib -lamdhip64 ex.hip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <hip/hip_runtime.h> | |
__global__ void square(int* array, int n) { | |
int tid = blockDim.x * blockIdx.x + threadIdx.x; | |
if (tid < n) | |
array[tid] = array[tid] * array[tid]; | |
} | |
int main() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment