Skip to content

Commit

Permalink
fix cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
enricozb committed May 30, 2024
1 parent a51bcf2 commit 934d4a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hvm.cu
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ __global__ void print_heatmap(GNet* gnet, u32 turn);
// Utils
// -----

inline f32 clamp(f32 x, f32 min, f32 max) {
__device__ __host__ f32 clamp(f32 x, f32 min, f32 max) {
const f32 t = x < min ? min : x;
return (t > max) ? max : t;
}
Expand Down Expand Up @@ -561,7 +561,7 @@ __device__ __host__ inline bool is_cast(Numb word) {
// saturating if out of range and 0 if NaN
// - i24 -> f24,
// u24 -> f24: casts to the "closest" float representing this integer.
static inline Numb cast(Numb a, Numb b) {
__device__ __host__ inline Numb cast(Numb a, Numb b) {
if (get_sym(a) == TY_U24 && get_typ(b) == TY_U24) return b;
if (get_sym(a) == TY_U24 && get_typ(b) == TY_I24) {
// reinterpret bits
Expand Down

0 comments on commit 934d4a0

Please sign in to comment.