mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
Merge pull request #27288 from ruisv:ruisv-cuda1209-npp-patch-1
CUDA 12.9 support: build NppStreamContext manually
This commit is contained in:
@@ -147,7 +147,23 @@ namespace cv { namespace cuda
|
||||
inline explicit NppStreamHandler(cudaStream_t newStream)
|
||||
{
|
||||
nppStreamContext = {};
|
||||
nppSafeCall(nppGetStreamContext(&nppStreamContext));
|
||||
#if CUDA_VERSION < 12090
|
||||
nppSafeCall(nppGetStreamContext(&nppStreamContext));
|
||||
#else
|
||||
int device = 0;
|
||||
cudaSafeCall(cudaGetDevice(&device));
|
||||
|
||||
cudaDeviceProp prop{};
|
||||
cudaSafeCall(cudaGetDeviceProperties(&prop, device));
|
||||
|
||||
nppStreamContext.nCudaDeviceId = device;
|
||||
nppStreamContext.nMultiProcessorCount = prop.multiProcessorCount;
|
||||
nppStreamContext.nMaxThreadsPerMultiProcessor = prop.maxThreadsPerMultiProcessor;
|
||||
nppStreamContext.nMaxThreadsPerBlock = prop.maxThreadsPerBlock;
|
||||
nppStreamContext.nSharedMemPerBlock = prop.sharedMemPerBlock;
|
||||
nppStreamContext.nCudaDevAttrComputeCapabilityMajor = prop.major;
|
||||
nppStreamContext.nCudaDevAttrComputeCapabilityMinor = prop.minor;
|
||||
#endif
|
||||
nppStreamContext.hStream = newStream;
|
||||
cudaSafeCall(cudaStreamGetFlags(nppStreamContext.hStream, &nppStreamContext.nStreamFlags));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user