Skip to content

Commit

Permalink
Merge branch 'sparse-fix-cuda65' of github.com:shehzan10/arrayfire in…
Browse files Browse the repository at this point in the history
…to hotfix-3.4.2
  • Loading branch information
shehzan10 committed Dec 16, 2016
2 parents bff51db + 93bbcb7 commit 2893fe0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/backend/cuda/sparse.cu
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ Array<T> sparseConvertStorageToDense(const SparseArray<T> &in)
return dense;
}

// Some of the API used here is available only in CUDA 7 or newer
#if CUDA_VERSION >= 7000
template<typename T, af_storage dest, af_storage src>
SparseArray<T> sparseConvertStorageToStorage(const SparseArray<T> &in)
{
Expand Down Expand Up @@ -475,6 +477,14 @@ SparseArray<T> sparseConvertStorageToStorage(const SparseArray<T> &in)

return converted;
}
#else // CUDA 6.5 and older (older than 7)
template<typename T, af_storage dest, af_storage src>
SparseArray<T> sparseConvertStorageToStorage(const SparseArray<T> &in)
{
AF_ERROR("Sparse storage format conversions are not supported for CUDA 6.5 or older",
AF_ERR_NOT_SUPPORTED);
}
#endif // CUDA_VERSION >= 7000

#define INSTANTIATE_TO_STORAGE(T, S) \
template SparseArray<T> sparseConvertStorageToStorage<T, S, AF_STORAGE_CSR>(const SparseArray<T> &in); \
Expand Down

0 comments on commit 2893fe0

Please sign in to comment.