mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Generate error when an explicit stream argument is not provided in the <<<...>>> kernel launch syntax (#6599)
* Generate error when an explicit stream argument is not provided in the <<<...>>> kernel launch syntax Co-authored-by: Weixing Zhang <wezhan@microsoft.com>
This commit is contained in:
parent
d18aa45b46
commit
c86c21e002
2 changed files with 5 additions and 2 deletions
|
|
@ -1199,6 +1199,9 @@ if (onnxruntime_USE_CUDA)
|
|||
endif()
|
||||
endif()
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr")
|
||||
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11)
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --Werror default-stream-launch")
|
||||
endif()
|
||||
if (NOT WIN32)
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --compiler-options -fPIC")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ __global__ void cuda_add_impl(int64_t N, float* O, const float* X, const float*
|
|||
}
|
||||
|
||||
void cuda_add(int64_t N, float* O, const float* X, const float* Y) {
|
||||
cuda_add_impl<<<1, 256>>>(N, O, X, Y);
|
||||
cuda_add_impl<<<1, 256, 0, 0>>>(N, O, X, Y);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
@ -28,7 +28,7 @@ __global__ void cuda_slice_impl(const T* X , int64_t from, int64_t to, T* Y) {
|
|||
|
||||
template<typename T>
|
||||
void cuda_slice(const T* X, int64_t from, int64_t to, T* Y) {
|
||||
cuda_slice_impl<T><<<1, 256>>>(X, from, to, Y);
|
||||
cuda_slice_impl<T><<<1, 256, 0, 0>>>(X, from, to, Y);
|
||||
}
|
||||
|
||||
template void cuda_slice(const float*, int64_t, int64_t, float*);
|
||||
|
|
|
|||
Loading…
Reference in a new issue