We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm a long-time CUDA developer trying to learn more about HIP and ROCm, but the documentation is making that difficult.
The most fundamental construct in CUDA is the kernel, so I started by reading https://rocm.docs.amd.com/projects/HIP/en/latest/reference/kernel_language.html
which contains a few example snippets illustrating how to write kernels for HIP. The first is:
// Example pseudo code introducing hipLaunchKernelGGL: __global__ MyKernel(hipLaunchParm lp, float *A, float *B, float *C, size_t N) { ... } MyKernel<<<dim3(gridDim), dim3(groupDim), 0, 0>>> (a,b,c,n); // Alternatively, kernel can be launched by // hipLaunchKernelGGL(MyKernel, dim3(gridDim), dim3(groupDim), 0/*dynamicShared*/, 0/*stream), a, b, c, n);
Maybe I'm missing something, but this code doesn't seem to work at all.
It has a handful of problems:
cpp
void
The next snippet on the page:
// Example showing device function, __device__ __host__ // <- compile for both device and host float PlusOne(float x) { return x + 1.0; } __global__ void MyKernel (hipLaunchParm lp, /*lp parm for execution configuration */ const float *a, const float *b, float *c, unsigned N) { unsigned gid = threadIdx.x; // <- coordinate index function if (gid < N) { c[gid] = a[gid] + PlusOne(b[gid]); } } void callMyKernel() { float *a, *b, *c; // initialization not shown... unsigned N = 1000000; const unsigned blockSize = 256; MyKernel<<<dim3(gridDim), dim3(groupDim), 0, 0>>> (a,b,c,n); // Alternatively, kernel can be launched by // hipLaunchKernelGGL(MyKernel, dim3(N/blockSize), dim3(blockSize), 0, 0, a,b,c,N); }
also has a lot of errors
__host__
__device__
N
n
No response
The text was updated successfully, but these errors were encountered:
@samuelpmish Internal ticket has been created to fix the documentation. Thanks!
Sorry, something went wrong.
kjayapra-amd
No branches or pull requests
Description of errors
I'm a long-time CUDA developer trying to learn more about HIP and ROCm, but the documentation is making that difficult.
The most fundamental construct in CUDA is the kernel, so I started by reading https://rocm.docs.amd.com/projects/HIP/en/latest/reference/kernel_language.html
which contains a few example snippets illustrating how to write kernels for HIP. The first is:
Maybe I'm missing something, but this code doesn't seem to work at all.
It has a handful of problems:
cpp
to the markdown code fences)void
return typeThe next snippet on the page:
also has a lot of errors
__host__
__device__
annotationsN
vsn
)Attach any links, screenshots, or additional evidence you think will be helpful.
No response
The text was updated successfully, but these errors were encountered: