Skip to content

Commit 1ad6966

Browse files
committed
Add CUDA build version defines in public headers
Change-Id: Ic5255886493dcd918ec22ad4f20df910080c1898
1 parent 2c3a5f4 commit 1ad6966

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

cpp/src/arrow/gpu/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ install(
114114
FILES "${CMAKE_CURRENT_BINARY_DIR}/arrow-gpu.pc"
115115
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
116116

117+
# CUDA build version
118+
configure_file(cuda_version.h.in
119+
"${CMAKE_CURRENT_BINARY_DIR}/cuda_version.h"
120+
@ONLY)
121+
122+
install(FILES
123+
"${CMAKE_CURRENT_BINARY_DIR}/cuda_version.h"
124+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/arrow/gpu")
125+
117126
set(ARROW_GPU_TEST_LINK_LIBS
118127
arrow_gpu_shared
119128
${ARROW_TEST_LINK_LIBS})

cpp/src/arrow/gpu/cuda_api.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
#ifndef ARROW_GPU_CUDA_API_H
19+
#define ARROW_GPU_CUDA_API_H
20+
21+
#include "arrow/gpu/cuda_memory.h"
22+
#include "arrow/gpu/cuda_version.h"
23+
24+
#endif // ARROW_GPU_CUDA_API_H
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
#ifndef ARROW_GPU_CUDA_VERSION_H
19+
#define ARROW_GPU_CUDA_VERSION_H
20+
21+
// Set the CUDA version used to build the library
22+
#define ARROW_CUDA_ABI_VERSION_MAJOR @CUDA_VERSION_MAJOR@
23+
#define ARROW_CUDA_ABI_VERSION_MINOR @CUDA_VERSION_MINOR@
24+
25+
#endif // ARROW_GPU_CUDA_VERSION_H

0 commit comments

Comments
 (0)