Skip to content

Commit b748c99

Browse files
committed
CUTensorMap is only in CUDA v12
The documentation at https://docs.nvidia.com/cuda/cutensor/latest/ say it's supported in 11.0, 11.8, and 12.x Our local testing against 11.7 fails because none of the required types or functions are declared in the header. It's safer to remain buildable with older versions but with this feature disabled than requiring a version bump that isn't otherwise warranted.
1 parent 8990dfe commit b748c99

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

source/adapters/cuda/tensor_map.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@
1313

1414
#include "context.hpp"
1515

16+
#if CUDA_VERSION < 12000
17+
UR_APIEXPORT ur_result_t UR_APICALL urTensorMapEncodeIm2ColExp(
18+
ur_device_handle_t, ur_exp_tensor_map_data_type_flags_t, uint32_t, void *,
19+
const uint64_t *, const uint64_t *, const int *, const int *, uint32_t,
20+
uint32_t, const uint32_t *, ur_exp_tensor_map_interleave_flags_t,
21+
ur_exp_tensor_map_swizzle_flags_t, ur_exp_tensor_map_l2_promotion_flags_t,
22+
ur_exp_tensor_map_oob_fill_flags_t, ur_exp_tensor_map_handle_t *) {
23+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
24+
}
25+
UR_APIEXPORT ur_result_t UR_APICALL urTensorMapEncodeTiledExp(
26+
ur_device_handle_t, ur_exp_tensor_map_data_type_flags_t, uint32_t, void *,
27+
const uint64_t *, const uint64_t *, const uint32_t *, const uint32_t *,
28+
ur_exp_tensor_map_interleave_flags_t, ur_exp_tensor_map_swizzle_flags_t,
29+
ur_exp_tensor_map_l2_promotion_flags_t, ur_exp_tensor_map_oob_fill_flags_t,
30+
ur_exp_tensor_map_handle_t *) {
31+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
32+
}
33+
#else
1634
struct ur_exp_tensor_map_handle_t_ {
1735
CUtensorMap Map;
1836
};
@@ -140,3 +158,4 @@ UR_APIEXPORT ur_result_t UR_APICALL urTensorMapEncodeTiledExp(
140158
}
141159
return UR_RESULT_SUCCESS;
142160
}
161+
#endif

0 commit comments

Comments
 (0)