Skip to content

Instantly share code, notes, and snippets.

@cgmb
Created January 17, 2023 23:17
Show Gist options
  • Save cgmb/09200700df3bd6122e33df5794df7e12 to your computer and use it in GitHub Desktop.
Save cgmb/09200700df3bd6122e33df5794df7e12 to your computer and use it in GitHub Desktop.
Clang offload bundle example
#!/bin/sh
/opt/rocm/llvm/bin/clang++ --offload-arch=gfx906:xnack- -L/opt/rocm/hip/lib -lamdhip64 ex.hip
#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