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

What is the meaning of the gpuparams (64,256,1,1,1,1) ? #85

Open
Jiede1 opened this issue Sep 25, 2018 · 4 comments
Open

What is the meaning of the gpuparams (64,256,1,1,1,1) ? #85

Jiede1 opened this issue Sep 25, 2018 · 4 comments

Comments

@Jiede1
Copy link

Jiede1 commented Sep 25, 2018

Hello,i am studying the codes on the test examples beneath the gpuenabler dirctory,and I can't understand the meaning of the number like (64,256,1,...) ? Could you please explain this?
image
image

@josiahsams
Copy link
Member

The register CUDA kernel will be invoked twice (2 stages) and we are providing the GPU dimensions for each stage (64, 256, 1, 1, 1, 1).

In this case, it means for the first stage, schedule the kernel with a 256: threadsPerBlock.x and 64: blockDim.x and set the blockDim.y,blockDim.z,threadsPerBlock.y,threadsPerBlock.z to 1.

That particular kernel is expected to be executed in two stages Ref: https://github.com/IBMSparkGPU/GPUEnabler/blob/master/examples/src/main/resources/SparkGPUExamples.cu#L29

So reduce operations are done in 2 stages, Block-vise reduce and 1 whole reduce with just one block & one thread.

Hope it helps.

@Jiede1
Copy link
Author

Jiede1 commented Sep 26, 2018

Thanks, but I have another question now ...if 64 means blockDim.x ,then the number of the threads of a block are 6411 =64 ,and threadsPerBlock.x is 256 , not 64 , it doesn't make sense...

@josiahsams
Copy link
Member

To be clear, Number of Blocks required is 64(GridDim.x) and each block is of size 256 (blockDim.x).

Refer to this PR for more clarity, #60

@Jiede1
Copy link
Author

Jiede1 commented Sep 28, 2018

thanks a lot ,it helps.

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