Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions paddle/phi/backends/gpu/gpu_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ struct GPUContext::Impl {
}
}
#ifdef PADDLE_WITH_CUDA
#if CUDA_VERSION >= 9000
if (!blas_tensor_core_handle_) {
if (!blas_tensor_core_handle_creator_) {
phi::InitBlasHandle(&blas_tensor_core_handle_, stream());
Expand All @@ -404,8 +403,6 @@ struct GPUContext::Impl {
PADDLE_RETRY_CUDA_SUCCESS(phi::dynload::cublasSetMathMode(
blas_tensor_core_handle_, CUBLAS_TENSOR_OP_MATH));
}
#endif
#if CUDA_VERSION >= 11000
if (!blas_tf32_tensor_core_handle_) {
if (!blas_tf32_tensor_core_handle_creator_) {
phi::InitBlasHandle(&blas_tf32_tensor_core_handle_, stream());
Expand All @@ -416,7 +413,6 @@ struct GPUContext::Impl {
PADDLE_RETRY_CUDA_SUCCESS(phi::dynload::cublasSetMathMode(
blas_tf32_tensor_core_handle_, CUBLAS_TF32_TENSOR_OP_MATH));
}
#endif
#endif
});
PADDLE_ENFORCE_NOT_NULL(
Expand Down Expand Up @@ -611,7 +607,6 @@ struct GPUContext::Impl {
}
}
#ifdef PADDLE_WITH_CUDA
#if CUDA_VERSION >= 9000
if (!blas_tensor_core_handle_) {
if (!blas_tensor_core_handle_creator_) {
phi::InitBlasHandle(&blas_tensor_core_handle_, stream());
Expand All @@ -621,8 +616,6 @@ struct GPUContext::Impl {
PADDLE_RETRY_CUDA_SUCCESS(phi::dynload::cublasSetMathMode(
blas_tensor_core_handle_, CUBLAS_TENSOR_OP_MATH));
}
#endif
#if CUDA_VERSION >= 11000
if (!blas_tf32_tensor_core_handle_) {
if (!blas_tf32_tensor_core_handle_creator_) {
phi::InitBlasHandle(&blas_tf32_tensor_core_handle_, stream());
Expand All @@ -633,7 +626,6 @@ struct GPUContext::Impl {
PADDLE_RETRY_CUDA_SUCCESS(phi::dynload::cublasSetMathMode(
blas_tf32_tensor_core_handle_, CUBLAS_TF32_TENSOR_OP_MATH));
}
#endif
#endif
});
if (blas_tf32_tensor_core_handle_ && phi::AllowTF32Cublas()) {
Expand All @@ -656,7 +648,6 @@ struct GPUContext::Impl {
}
}
#ifdef PADDLE_WITH_CUDA
#if CUDA_VERSION >= 9000
if (!blas_tensor_core_handle_) {
if (!blas_tensor_core_handle_creator_) {
phi::InitBlasHandle(&blas_tensor_core_handle_, stream());
Expand All @@ -666,8 +657,6 @@ struct GPUContext::Impl {
PADDLE_RETRY_CUDA_SUCCESS(phi::dynload::cublasSetMathMode(
blas_tensor_core_handle_, CUBLAS_TENSOR_OP_MATH));
}
#endif
#if CUDA_VERSION >= 11000
if (!blas_tf32_tensor_core_handle_) {
if (!blas_tf32_tensor_core_handle_creator_) {
phi::InitBlasHandle(&blas_tf32_tensor_core_handle_, stream());
Expand All @@ -678,7 +667,6 @@ struct GPUContext::Impl {
PADDLE_RETRY_CUDA_SUCCESS(phi::dynload::cublasSetMathMode(
blas_tf32_tensor_core_handle_, CUBLAS_TF32_TENSOR_OP_MATH));
}
#endif
#endif
});
if (blas_tensor_core_handle_ != nullptr) {
Expand Down
6 changes: 0 additions & 6 deletions paddle/phi/backends/gpu/gpu_resources.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,9 @@ void DestroySolverHandle(solverHandle_t solver_handle) {
}

void InitSparseHandle(sparseHandle_t* handle, gpuStream_t stream) {
// ROCM is not yet supported
#if defined(PADDLE_WITH_CUDA)
// The generic APIs is supported from CUDA10.1
#if CUDA_VERSION >= 11000
PADDLE_RETRY_CUDA_SUCCESS(dynload::cusparseCreate(handle));
PADDLE_RETRY_CUDA_SUCCESS(dynload::cusparseSetStream(*handle, stream));
#endif
#elif defined(PADDLE_WITH_HIP)
phi::dynload::rocsparse_create_handle(handle);
phi::dynload::rocsparse_set_stream(*handle, stream);
Expand All @@ -311,12 +307,10 @@ void InitSparseHandle(sparseHandle_t* handle, gpuStream_t stream) {

void DestroySparseHandle(sparseHandle_t handle) {
#ifdef PADDLE_WITH_CUDA
#if CUDA_VERSION >= 11000
if (handle != nullptr) {
PADDLE_RETRY_CUDA_SUCCESS(dynload::cusparseDestroy(handle));
handle = nullptr;
}
#endif
#elif defined(PADDLE_WITH_HIP)
if (handle != nullptr) {
phi::dynload::rocsparse_destroy_handle(handle);
Expand Down
Loading