| 31 | template<const unsigned int BlockSize, class T> |
| 32 | __global__ __launch_bounds__(BlockSize) |
| 33 | void example_shared_memory(const T* input, T* output) |
| 34 | { |
| 35 | // Indexing for this block |
| 36 | unsigned int index = (blockIdx.x * BlockSize) + threadIdx.x; |
| 37 | |
| 38 | // Allocating storage in shared memory for the block |
| 39 | using block_scan_type = rocprim::block_scan<T, BlockSize>; |
| 40 | __shared__ typename block_scan_type::storage_type storage; |
| 41 | |
| 42 | // Variables required for performing a scan |
| 43 | T input_value, output_value; |
| 44 | |
| 45 | // Execute inclusive plus scan |
| 46 | input_value = input[index]; |
| 47 | |
| 48 | block_scan_type().inclusive_scan(input_value, output_value, storage, rocprim::plus<T>()); |
| 49 | |
| 50 | output[index] = output_value; |
| 51 | } |
| 52 | |
| 53 | // Host function that runs example_shared_memory kernel |
| 54 | template<class T> |
nothing calls this directly
no test coverage detected