|
| 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 | +cuda_dep = dependency('cuda') |
| 19 | + |
| 20 | +arrow_cuda_srcs = [ |
| 21 | + 'cuda_arrow_ipc.cc', |
| 22 | + 'cuda_context.cc', |
| 23 | + 'cuda_internal.cc', |
| 24 | + 'cuda_memory.cc', |
| 25 | +] |
| 26 | + |
| 27 | +arrow_cuda_lib = library( |
| 28 | + 'arrow-cuda', |
| 29 | + sources: [arrow_cuda_srcs], |
| 30 | + dependencies: [arrow_dep, cuda_dep, flatbuffers_dep], |
| 31 | + cpp_args: ['-DARROW_CUDA_EXPORTING'], |
| 32 | +) |
| 33 | + |
| 34 | +arrow_cuda_dep = declare_dependency( |
| 35 | + link_with: [arrow_cuda_lib], |
| 36 | + dependencies: [cuda_dep], |
| 37 | +) |
| 38 | + |
| 39 | +cuda_version = cuda_dep.version() |
| 40 | +cuda_split_version = cuda_version.split('.') |
| 41 | +cuda_conf_data = configuration_data() |
| 42 | +cuda_conf_data.set('CUDA_VERSION_MAJOR', cuda_split_version[0]) |
| 43 | +cuda_conf_data.set('CUDA_VERSION_MINOR', cuda_split_version[1]) |
| 44 | + |
| 45 | +configure_file( |
| 46 | + input: 'cuda_version.h.in', |
| 47 | + output: 'cuda_version.h', |
| 48 | + configuration: cuda_conf_data, |
| 49 | + install_dir: 'arrow/gpu', |
| 50 | +) |
| 51 | + |
| 52 | +install_headers( |
| 53 | + [ |
| 54 | + 'cuda_api.h', |
| 55 | + 'cuda_arrow_ipc.h', |
| 56 | + 'cuda_context.h', |
| 57 | + 'cuda_internal.h', |
| 58 | + 'cuda_memory.h', |
| 59 | + 'visibility.h', |
| 60 | + ], |
| 61 | + subdir: 'arrow/gpu', |
| 62 | +) |
| 63 | + |
| 64 | +exc = executable( |
| 65 | + 'arrow-cuda-test', |
| 66 | + sources: ['cuda_test.cc'], |
| 67 | + dependencies: [arrow_test_dep, arrow_cuda_dep], |
| 68 | +) |
| 69 | +test('arrow-cuda-test', exc) |
| 70 | + |
| 71 | +exc = executable( |
| 72 | + 'arrow-cuda-benchmark', |
| 73 | + sources: ['cuda_benchmark.cc'], |
| 74 | + dependencies: [arrow_benchmark_dep, arrow_cuda_dep], |
| 75 | +) |
| 76 | +benchmark('arrow-gpu-cuda-benchmark', exc) |
0 commit comments