Skip to content

Commit

Permalink
account for ld versions of cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
dmenig committed Apr 26, 2022
1 parent 0705661 commit 674d143
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/cpp/cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ namespace pycuda
return result;
}

#if CUDAPP_CUDA_VERSION >= 7500
inline
py::tuple get_stream_priority_range()
{
Expand All @@ -869,6 +870,7 @@ namespace pycuda
CUDAPP_CALL_GUARDED(cuCtxGetStreamPriorityRange, (&leastPriority, &greatestPriority));
return py::make_tuple(leastPriority, greatestPriority);
}
#endif



Expand Down Expand Up @@ -1006,8 +1008,17 @@ namespace pycuda
CUstream m_stream;

public:
stream(unsigned int flags=0, int priority=0)
{ CUDAPP_CALL_GUARDED(cuStreamCreateWithPriority, (&m_stream, flags, priority)); }

#if CUDAPP_CUDA_VERSION >= 7500
stream(unsigned int flags=0, int priority=0)
{ CUDAPP_CALL_GUARDED(cuStreamCreateWithPriority, (&m_stream, flags, priority)); }
#else
if (priority != 0)
throw pycuda::error("stream", CUDA_ERROR_INVALID_HANDLE,
"priority!=0 setting isn't supported for your CUDA version");
stream(unsigned int flags=0)
{ CUDAPP_CALL_GUARDED(cuStreamCreate, (&m_stream, flags)); }
#endif

~stream()
{
Expand Down

0 comments on commit 674d143

Please sign in to comment.