2
votes

I have a couple of beginner questions, my laptop's GPU has:

  • 2 compute units
  • a local memory size of 48 KB
  • Max Work-group Total Size of 1024
  • max_work_item_sizes:( 1024 1024 64 )

My questions are quite simple:

  1. Those 48 KB of local memory are per compute unit or for the whole GPU?
  2. If I only create one work group, does that mean that openCL won't use half of my GPU's capcity?
  3. is there a relation between max work-group total size and max_work_item_sizes?

Thanks a lot for your help

2
but you can't cross individual max values - huseyin tugrul buyukisik

2 Answers

1
votes

1) Per compute unit.

2) If vendor implementation can use all compute units for a single workgroup, then it wouldn't matter. Nvidia and Amd can't do this so they use single compute unit. Using a single workgroup also doesn't fully use a compute unit. Needs at least several workgroups to tens of workgroups per compute unit to become efficient.

3) No. You can use any work group size as long as its an integer divider of total work item size. But you can't cross that max values.

1
votes

Just to clarify @huseyin answer with more information.

Compute unit != Local workgroup

A compute unit is a core that can be working on a given task, but it can internally have many workgroups being executed in many different stages of processing. In order to maximize the utilization and minimize memory latency effects.

The values reported by OpenCL are maximum values. If you use the total 1024 items it may give you smaller local memory available. Or using all the local memory, it may forbid the compute unit to run work groups in parallel, which will slow down the execution. Always use the values you need, not the maximum ones.

Use the values reported after the kernel compilation CL_KERNEL_WORK_GROUP_SIZE for setting up the execution. Not the ones given by the device.