Skip to content
New issue

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

please, I conftoned of a trouble in Cuda 12 #13

Open
TycheLime opened this issue Mar 16, 2023 · 3 comments
Open

please, I conftoned of a trouble in Cuda 12 #13

TycheLime opened this issue Mar 16, 2023 · 3 comments

Comments

@TycheLime
Copy link

No description provided.

@TycheLime TycheLime changed the title please, I met please, I conftoned of a trouble in Cuda 12 Mar 16, 2023
@TycheLime
Copy link
Author

template<int N,typename T>
global void kernel(T* arr) {
for (int i = blockDim.x * blockIdx.x + threadIdx; i < N; i += blockDim.x * gridDim.x) {
arr[i] = i;
}
}

@TycheLime
Copy link
Author

the above code can not compile.

@Crown40
Copy link

Crown40 commented Jul 19, 2023

int i = blockDim.x * blockIdx.x + threadIdx =should be altered as>int i = blockDim.x * blockIdx.x + threadIdx.x

template<int N,typename T> global void kernel(T* arr) { for (int i = blockDim.x * blockIdx.x + threadIdx; i < N; i += blockDim.x * gridDim.x) { arr[i] = i; } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants