EnqueueArgs is a kernel launch configuration composition object This structure is an composition of various parameters that are required to successfully launch a CUDA kernel.
| 24 | /// required to successfully launch a CUDA kernel. |
| 25 | /// |
| 26 | struct EnqueueArgs { |
| 27 | // TODO(pradeep): this can be easily templated |
| 28 | // template<typename Queue, typename Event> |
| 29 | dim3 mBlocks; ///< Number of blocks per grid/kernel-launch |
| 30 | dim3 mThreads; ///< Number of threads per block |
| 31 | CUstream mStream; ///< CUDA stream to enqueue the kernel on |
| 32 | unsigned int mSharedMemSize; ///< Size(in bytes) of shared memory used |
| 33 | std::vector<CUevent> mEvents; ///< Events to wait for kernel execution |
| 34 | |
| 35 | /// |
| 36 | /// \brief EnqueueArgs constructor |
| 37 | /// |
| 38 | /// \param[in] blks is number of blocks per grid |
| 39 | /// \param[in] thrds is number of threads per block |
| 40 | /// \param[in] stream is CUDA steam on which kernel has to be enqueued |
| 41 | /// \param[in] sharedMemSize is number of bytes of shared memory allocation |
| 42 | /// \param[in] events is list of events to wait for kernel execution |
| 43 | /// |
| 44 | EnqueueArgs(dim3 blks, dim3 thrds, CUstream stream = 0, |
| 45 | const unsigned int sharedMemSize = 0, |
| 46 | const std::vector<CUevent> &events = {}) |
| 47 | : mBlocks(blks) |
| 48 | , mThreads(thrds) |
| 49 | , mStream(stream) |
| 50 | , mSharedMemSize(sharedMemSize) |
| 51 | , mEvents(events) {} |
| 52 | }; |
| 53 | |
| 54 | } // namespace cuda |
| 55 | } // namespace arrayfire |
no outgoing calls
no test coverage detected