The amount of dynamic shared memory available per block when launching `blocks` on a streaming multiprocessor.
(
&self,
blocks: GridSize,
block_size: BlockSize,
)
| 320 | /// The amount of dynamic shared memory available per block when launching `blocks` on |
| 321 | /// a streaming multiprocessor. |
| 322 | pub fn available_dynamic_shared_memory_per_block( |
| 323 | &self, |
| 324 | blocks: GridSize, |
| 325 | block_size: BlockSize, |
| 326 | ) -> CudaResult<usize> { |
| 327 | let num_blocks = blocks.x * blocks.y * blocks.z; |
| 328 | let total_block_size = block_size.x * block_size.y * block_size.z; |
| 329 | |
| 330 | let mut result = MaybeUninit::uninit(); |
| 331 | unsafe { |
| 332 | cuda::cuOccupancyAvailableDynamicSMemPerBlock( |
| 333 | result.as_mut_ptr(), |
| 334 | self.to_raw(), |
| 335 | num_blocks as i32, |
| 336 | total_block_size as i32, |
| 337 | ) |
| 338 | .to_result()?; |
| 339 | Ok(result.assume_init()) |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | /// The maximum number of active blocks per streaming multiprocessor when this function |
| 344 | /// is launched with a specific `block_size` with some amount of dynamic shared memory. |
nothing calls this directly
no test coverage detected