From 730b8a5bbee5a59c598c81bd8ef390a1c5e54f74 Mon Sep 17 00:00:00 2001 From: Allard Hendriksen Date: Fri, 5 May 2023 12:15:48 +0200 Subject: [PATCH] Try to reproduce issue #1490 I cannot reproduce the linker error. Building with clang 11.1 and nvcc 11.8. Both test files have raft::cache::(anonymous namespace)::get_cache_idx defined though.. $ nm -g -C cpp/build/CMakeFiles/UTILS_TEST.dir/test/util/get_cache_idx_1.cu.o | grep get_cache_idx U __cudaRegisterLinkedBinary_667dac6a_18_get_cache_idx_1_cu_eeb3336e_3832672 0000000000000000 D __fatbinwrap_667dac6a_18_get_cache_idx_1_cu_eeb3336e_3832672 0000000000000010 T __device_stub__ZN4raft5cache59_GLOBAL__N__667dac6a_18_get_cache_idx_1_cu_eeb3336e_383267213get_cache_idxEPiiS2_iiS2_S2_Pbi(int*, int, int*, int, int, int*, int*, bool*, int) 0000000000000000 T raft::cache::(anonymous namespace)::get_cache_idx(int*, int, int*, int, int, int*, int*, bool*, int) $ nm -g -C cpp/build/CMakeFiles/UTILS_TEST.dir/test/util/get_cache_idx_2.cu.o | grep get_cache_idx U __cudaRegisterLinkedBinary_74c80384_18_get_cache_idx_2_cu_a658dc80 0000000000000000 D __fatbinwrap_74c80384_18_get_cache_idx_2_cu_a658dc80 0000000000000010 T __device_stub__ZN4raft5cache51_GLOBAL__N__74c80384_18_get_cache_idx_2_cu_a658dc8013get_cache_idxEPiiS2_iiS2_S2_Pbi(int*, int, int*, int, int, int*, int*, bool*, int) 0000000000000000 T raft::cache::(anonymous namespace)::get_cache_idx(int*, int, int*, int, int, int*, int*, bool*, int) --- cpp/test/CMakeLists.txt | 8 ++++++++ cpp/test/util/get_cache_idx_1.cu | 19 +++++++++++++++++++ cpp/test/util/get_cache_idx_2.cu | 19 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 cpp/test/util/get_cache_idx_1.cu create mode 100644 cpp/test/util/get_cache_idx_2.cu diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 7f45a6dd22..aeb39ee7ff 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -372,5 +372,13 @@ if(BUILD_TESTS) ConfigureTest( NAME UTILS_TEST PATH test/core/seive.cu test/util/bitonic_sort.cu test/util/cudart_utils.cpp test/util/device_atomics.cu test/util/integer_utils.cpp test/util/pow2_utils.cu + test/util/get_cache_idx_1.cu + test/util/get_cache_idx_2.cu ) + set_target_properties( + UTILS_TEST + PROPERTIES + CUDA_SEPARABLE_COMPILATION ON + ) + endif() diff --git a/cpp/test/util/get_cache_idx_1.cu b/cpp/test/util/get_cache_idx_1.cu new file mode 100644 index 0000000000..14b014746b --- /dev/null +++ b/cpp/test/util/get_cache_idx_1.cu @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + diff --git a/cpp/test/util/get_cache_idx_2.cu b/cpp/test/util/get_cache_idx_2.cu new file mode 100644 index 0000000000..14b014746b --- /dev/null +++ b/cpp/test/util/get_cache_idx_2.cu @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +