Skip to content

Commit

Permalink
Merge #1742 support properly when disable half precision
Browse files Browse the repository at this point in the history
This PR supports properly when disable half precision. It keeps the support for those GPU with compute capability less than 5.3 before cuda 12.2

Related PR: #1742
  • Loading branch information
yhmtsai authored Dec 5, 2024
2 parents 3d30c04 + 2d5c6c4 commit f95fc48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Ginkgo adds the following additional switches to control what is being built:
Enabling this flag increases the library size, but improves performance of
mixed-precision kernels.
* `-DGINKGO_ENABLE_HALF={ON, OFF}` enable half precision support in Ginkgo, default is `ON`.
It is `OFF` when the compiler is MSVC.
It is `OFF` when the compiler is MSVC. If compiling is done with the CUDA backend before CUDA 12.2,
we only support half precision after compute capability 5.3. CUDA 12.2+ compilers waive the compute capbility limitation.
* `-DGINKGO_BUILD_TESTS={ON, OFF}` builds Ginkgo's tests
(will download googletest), default is `ON`.
* `-DGINKGO_FAST_TESTS={ON, OFF}` reduces the input sizes for a few slow tests
Expand Down
6 changes: 6 additions & 0 deletions common/cuda_hip/base/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ struct is_complex_or_scalar_impl<thrust::complex<T>>
} // namespace gko


#if GINKGO_ENABLE_HALF


GKO_THRUST_NAEMSPACE_PREFIX
namespace thrust {

Expand Down Expand Up @@ -186,4 +189,7 @@ __device__ __forceinline__ bool is_finite(const thrust::complex<__half>& value)
} // namespace gko


#endif // GINKGO_ENABLE_HALF


#endif // GKO_COMMON_CUDA_HIP_BASE_MATH_HPP_

0 comments on commit f95fc48

Please sign in to comment.