Changes to support build with CUDA 11 · arrayfire/arrayfire@2bcb476 · GitHub
Skip to content

Commit 2bcb476

Browse files
author
pradeep
committed
Changes to support build with CUDA 11
Also, updates CUB version from 1.8.0 to 1.9.10
1 parent 6d8db1d commit 2bcb476

6 files changed

Lines changed: 95 additions & 43 deletions

File tree

.gitmodules

Lines changed: 2 additions & 2 deletions

extern/cub

Submodule cub added at d106ddb

src/backend/cuda/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ cuda_include_directories(
101101
${ArrayFire_BINARY_DIR}/include
102102
${CMAKE_CURRENT_SOURCE_DIR}/kernel
103103
${CMAKE_CURRENT_SOURCE_DIR}/jit
104-
${CMAKE_CURRENT_SOURCE_DIR}/cub
105104
${ArrayFire_SOURCE_DIR}/src/api/c
106105
${ArrayFire_SOURCE_DIR}/src/backend
107106
${COMMON_INTERFACE_DIRS}
108107
)
108+
if(CUDA_VERSION_MAJOR VERSION_LESS 11)
109+
cuda_include_directories(${ArrayFire_SOURCE_DIR}/extern/cub)
110+
endif()
109111

110112
file(GLOB jit_src "kernel/jit.cuh")
111113

@@ -679,6 +681,12 @@ target_include_directories (afcuda
679681
${CMAKE_CURRENT_BINARY_DIR}
680682
)
681683
684+
if(CUDA_VERSION_MAJOR VERSION_LESS 11)
685+
target_include_directories(afcuda PRIVATE ${ArrayFire_SOURCE_DIR}/extern/cub)
686+
target_include_directories(af_cuda_static_cuda_library
687+
PRIVATE ${ArrayFire_SOURCE_DIR}/extern/cub)
688+
endif()
689+
682690
target_link_libraries(afcuda
683691
PRIVATE
684692
c_api_interface

src/backend/cuda/cub

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/backend/cuda/sparse.cu

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,6 @@ namespace cuda {
2828

2929
using namespace common;
3030

31-
// cusparseStatus_t cusparseZcsr2csc(cusparseHandle_t handle,
32-
// int m, int n, int nnz,
33-
// const cuDoubleComplex *csrSortedVal,
34-
// const int *csrSortedRowPtr, const int
35-
// *csrSortedColInd, cuDoubleComplex
36-
// *cscSortedVal, int *cscSortedRowInd, int
37-
// *cscSortedColPtr, cusparseAction_t
38-
// copyValues, cusparseIndexBase_t idxBase);
39-
40-
template<typename T>
41-
struct csr2csc_func_def_t {
42-
typedef cusparseStatus_t (*csr2csc_func_def)(cusparseHandle_t, int, int,
43-
int, const T *, const int *,
44-
const int *, T *, int *, int *,
45-
cusparseAction_t,
46-
cusparseIndexBase_t);
47-
};
48-
4931
// cusparseStatus_t cusparseZdense2csr(cusparseHandle_t handle,
5032
// int m, int n,
5133
// const cusparseMatDescr_t descrA,
@@ -144,12 +126,6 @@ struct gthr_func_def_t {
144126
cusparse##PREFIX##FUNC; \
145127
}
146128

147-
SPARSE_FUNC_DEF(csr2csc)
148-
SPARSE_FUNC(csr2csc, float, S)
149-
SPARSE_FUNC(csr2csc, double, D)
150-
SPARSE_FUNC(csr2csc, cfloat, C)
151-
SPARSE_FUNC(csr2csc, cdouble, Z)
152-
153129
SPARSE_FUNC_DEF(dense2csr)
154130
SPARSE_FUNC(dense2csr, float, S)
155131
SPARSE_FUNC(dense2csr, double, D)

src/backend/cuda/sparse_arith.cu

Lines changed: 83 additions & 15 deletions

0 commit comments

Comments
 (0)