Skip to content

Commit 7975faf

Browse files
authored
cuda13 almalinux trt (#75695)
1 parent 402b977 commit 7975faf

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

paddle/fluid/inference/tensorrt/plugin/anchor_generator_op_plugin.cu

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ size_t AnchorGeneratorPlugin::getWorkspaceSize(int max_batch_size) const
163163
return 0;
164164
}
165165

166-
#ifdef _WIN32
166+
#if defined(CUDA_VERSION) && CUDA_VERSION >= 13000 || defined(_WIN32)
167167
template <typename T>
168168
__global__ void GenAnchors(T* out,
169169
const T* aspect_ratios,
@@ -233,7 +233,7 @@ int AnchorGeneratorPlugin::enqueue_impl(int batch_size,
233233
const T* aspect_ratios_device = static_cast<const T*>(aspect_ratios_device_);
234234
const T* stride_device = static_cast<const T*>(stride_device_);
235235
const T* variances_device = static_cast<const T*>(variances_device_);
236-
#ifdef _WIN32
236+
#if defined(CUDA_VERSION) && CUDA_VERSION >= 13000 || defined(_WIN32)
237237
GenAnchors<T><<<gen_anchor_grid, block, 0, stream>>>(anchors,
238238
aspect_ratios_device,
239239
aspect_ratios_.size(),
@@ -258,7 +258,7 @@ int AnchorGeneratorPlugin::enqueue_impl(int batch_size,
258258
offset_);
259259
#endif
260260
const int var_grid = (box_num_ * 4 + block - 1) / block;
261-
#ifdef _WIN32
261+
#if defined(CUDA_VERSION) && CUDA_VERSION >= 13000 || defined(_WIN32)
262262
SetVariance<T><<<var_grid, block, 0, stream>>>(
263263
vars, variances_device, variances_.size(), box_num_ * 4);
264264
#else
@@ -592,7 +592,7 @@ int AnchorGeneratorPluginDynamic::enqueue_impl(
592592
const T* aspect_ratios_device = static_cast<const T*>(aspect_ratios_device_);
593593
const T* stride_device = static_cast<const T*>(stride_device_);
594594
const T* variances_device = static_cast<const T*>(variances_device_);
595-
#ifdef _WIN32
595+
#if defined(CUDA_VERSION) && CUDA_VERSION >= 13000 || defined(_WIN32)
596596
GenAnchors<T><<<gen_anchor_grid, block, 0, stream>>>(anchors,
597597
aspect_ratios_device,
598598
aspect_ratios_.size(),
@@ -617,7 +617,7 @@ int AnchorGeneratorPluginDynamic::enqueue_impl(
617617
offset_);
618618
#endif
619619
const int var_grid = (box_num * 4 + block - 1) / block;
620-
#ifdef _WIN32
620+
#if defined(CUDA_VERSION) && CUDA_VERSION >= 13000 || defined(_WIN32)
621621
SetVariance<T><<<var_grid, block, 0, stream>>>(
622622
vars, variances_device, variances_.size(), box_num * 4);
623623
#else
@@ -894,7 +894,7 @@ int PIRAnchorGeneratorPluginDynamic::enqueue_impl(
894894
const T* aspect_ratios_device = static_cast<const T*>(aspect_ratios_device_);
895895
const T* stride_device = static_cast<const T*>(stride_device_);
896896
const T* variances_device = static_cast<const T*>(variances_device_);
897-
#ifdef _WIN32
897+
#if defined(CUDA_VERSION) && CUDA_VERSION >= 13000 || defined(_WIN32)
898898
GenAnchors<T><<<gen_anchor_grid, block, 0, stream>>>(anchors,
899899
aspect_ratios_device,
900900
aspect_ratios_.size(),
@@ -919,7 +919,7 @@ int PIRAnchorGeneratorPluginDynamic::enqueue_impl(
919919
offset_);
920920
#endif
921921
const int var_grid = (box_num * 4 + block - 1) / block;
922-
#ifdef _WIN32
922+
#if defined(CUDA_VERSION) && CUDA_VERSION >= 13000 || defined(_WIN32)
923923
SetVariance<T><<<var_grid, block, 0, stream>>>(
924924
vars, variances_device, variances_.size(), box_num * 4);
925925
#else

0 commit comments

Comments
 (0)