Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:05:45

0001 #ifndef HeterogeneousCore_CUDACore_TestCUDAAnalyzerGPUKernel_h
0002 #define HeterogeneousCore_CUDACore_TestCUDAAnalyzerGPUKernel_h
0003 
0004 #include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
0005 
0006 #include <cuda_runtime.h>
0007 
0008 class TestCUDAAnalyzerGPUKernel {
0009 public:
0010   static constexpr int NUM_VALUES = 4000;
0011 
0012   TestCUDAAnalyzerGPUKernel(cudaStream_t stream);
0013   ~TestCUDAAnalyzerGPUKernel() = default;
0014 
0015   // thread safe
0016   void analyzeAsync(const float* d_input, cudaStream_t stream);
0017   float value(cudaStream_t stream) const;
0018 
0019 private:
0020   cms::cuda::device::unique_ptr<float[]> sum_;  // all writes are atomic in CUDA
0021 };
0022 
0023 #endif