|
6 | 6 | // |
7 | 7 | //===----------------------------------------------------------------------===// |
8 | 8 | // |
9 | | -// This file contains Offload API definitions related to launching kernels |
| 9 | +// This file contains Offload API definitions related to kernels |
10 | 10 | // |
11 | 11 | //===----------------------------------------------------------------------===// |
12 | 12 |
|
@@ -42,3 +42,21 @@ def : Function { |
42 | 42 | Return<"OL_ERRC_SYMBOL_KIND", ["The provided symbol is not a kernel"]>, |
43 | 43 | ]; |
44 | 44 | } |
| 45 | + |
| 46 | +def : Function { |
| 47 | + let name = "olCalculateOptimalOccupancy"; |
| 48 | + let desc = "Given dynamic memory size, query the device for a workgroup size that will result in optimal occupancy."; |
| 49 | + let details = [ |
| 50 | + "For most devices, this will be the largest workgroup size that will result in all work items fitting on the device at once.", |
| 51 | + ]; |
| 52 | + let params = [ |
| 53 | + Param<"ol_device_handle_t", "Device", "device intended to run the kernel", PARAM_IN>, |
| 54 | + Param<"ol_symbol_handle_t", "Kernel", "handle of the kernel", PARAM_IN>, |
| 55 | + Param<"size_t", "SharedMemory", "dynamic shared memory required per work item in bytes", PARAM_IN>, |
| 56 | + Param<"size_t*", "GroupSize", "optimal block size", PARAM_OUT> |
| 57 | + ]; |
| 58 | + let returns = [ |
| 59 | + Return<"OL_ERRC_SYMBOL_KIND", ["The provided symbol is not a kernel"]>, |
| 60 | + Return<"OL_ERRC_UNSUPPORTED", ["The backend cannot provide this information"]>, |
| 61 | + ]; |
| 62 | +} |
0 commit comments