3

Can I get maximum warp/work-group on one compute unit through some function like clGetDeviceInfo. From what I've found the number depends only on Compute capability.So is there any function that can detect it?

thx jikra

cizek
  • 31
  • 2

1 Answers1

1

I think you are looking for clGetKernelWorkGroupInfo.

Specifically, CL_KERNEL_WORK_GROUP_SIZE and CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE will help you tune your work group sizes.

mfa
  • 5,017
  • 2
  • 23
  • 28
  • Thank you for your answer, but i need anything else: I need to set the desired occupancy for some testing.So I need to know max. warp that can run on my HW and calculate the distribution of NDRange dimension near required occupancy. So I need the maximum possible number of active threads on compute unit that allows hardware. Can i find this? – cizek Jun 19 '12 at 21:22
  • from the link above: "CL_KERNEL_WORK_GROUP_SIZE size_t -- This provides a mechanism for the application to query the maximum work-group size that can be used to execute a kernel on a specific device given by device. The OpenCL implementation uses the resource requirements of the kernel (register usage etc.) to determine what this work-group size should be." – mfa Jun 20 '12 at 00:57
  • Yes, i understand this. Example. I have NVidia Qadro 3000M so i can have max 48 warp and 8 work-group per compute unit. If a have kernel with 63 registr then CL_KERNEL_WORK_GROUP_SIZE return 512. If i execute NDRange(1,1,1)(1,32,16), will be in one compute unit total 16 active warp. occupancy will be 16/48 = 0.33(33%) but if i exucute NDRange(2,1,1)(1,24,16) will be in one compute unit only 12 active warp. Occupancy will be 12/48 = 0.25(25%). For this calculation i need to know max active warp on compute unit – cizek Jun 20 '12 at 09:10