Skip to content

Commit

Permalink
EC/CUDA: fix build with 12.2 and older arch (openucx#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei-Lebedev authored and nsarka committed Oct 24, 2023
1 parent f26ade3 commit 76ceac7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/ec/cuda/kernel/ec_cuda_half_sm52.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* We copy-pasted and modify cuda_fp16.hpp because half operators are only available
* for SM>=5.3 but we need to support earlier architectures. On earlier architectures,
* we emulate the operators by converting half to float, do the operation, then convert
* the result back to half
* the result back to half.
* Since CUDA 12.2 similar functionality was added to cuda_fp16.hpp
*/

#pragma once
Expand All @@ -23,7 +24,7 @@

/* Arithmetic FP16 operations in cuda_fp16.hpp only supported on arch >= 5.3,
* however, we support early architectures*/
#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 530)
#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 530) && (CUDA_VERSION < 12020)
#if !defined(__CUDA_NO_HALF_OPERATORS__)

/* Some basic arithmetic operations expected of a builtin */
Expand Down

0 comments on commit 76ceac7

Please sign in to comment.