Skip to content

Commit

Permalink
Merge pull request #464 from ditotechnologies/gpu-comment-fix
Browse files Browse the repository at this point in the history
Update float.h "# else // GPU" comments
  • Loading branch information
mmp authored Nov 30, 2024
2 parents 3976fd7 + 49bba7c commit 88645ff
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/pbrt/util/float.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ inline PBRT_CPU_GPU Float AddRoundUp(Float a, Float b) {
#else
return __fadd_ru(a, b);
#endif
#else // GPU
#else // CPU
return NextFloatUp(a + b);
#endif
}
Expand All @@ -214,7 +214,7 @@ inline PBRT_CPU_GPU Float AddRoundDown(Float a, Float b) {
#else
return __fadd_rd(a, b);
#endif
#else // GPU
#else // CPU
return NextFloatDown(a + b);
#endif
}
Expand All @@ -233,7 +233,7 @@ inline PBRT_CPU_GPU Float MulRoundUp(Float a, Float b) {
#else
return __fmul_ru(a, b);
#endif
#else // GPU
#else // CPU
return NextFloatUp(a * b);
#endif
}
Expand All @@ -245,7 +245,7 @@ inline PBRT_CPU_GPU Float MulRoundDown(Float a, Float b) {
#else
return __fmul_rd(a, b);
#endif
#else // GPU
#else // CPU
return NextFloatDown(a * b);
#endif
}
Expand All @@ -257,7 +257,7 @@ inline PBRT_CPU_GPU Float DivRoundUp(Float a, Float b) {
#else
return __fdiv_ru(a, b);
#endif
#else // GPU
#else // CPU
return NextFloatUp(a / b);
#endif
}
Expand All @@ -269,7 +269,7 @@ inline PBRT_CPU_GPU Float DivRoundDown(Float a, Float b) {
#else
return __fdiv_rd(a, b);
#endif
#else // GPU
#else // CPU
return NextFloatDown(a / b);
#endif
}
Expand All @@ -281,7 +281,7 @@ inline PBRT_CPU_GPU Float SqrtRoundUp(Float a) {
#else
return __fsqrt_ru(a);
#endif
#else // GPU
#else // CPU
return NextFloatUp(std::sqrt(a));
#endif
}
Expand All @@ -293,7 +293,7 @@ inline PBRT_CPU_GPU Float SqrtRoundDown(Float a) {
#else
return __fsqrt_rd(a);
#endif
#else // GPU
#else // CPU
return std::max<Float>(0, NextFloatDown(std::sqrt(a)));
#endif
}
Expand All @@ -305,7 +305,7 @@ inline PBRT_CPU_GPU Float FMARoundUp(Float a, Float b, Float c) {
#else
return __fma_ru(a, b, c);
#endif
#else // GPU
#else // CPU
return NextFloatUp(FMA(a, b, c));
#endif
}
Expand All @@ -317,7 +317,7 @@ inline PBRT_CPU_GPU Float FMARoundDown(Float a, Float b, Float c) {
#else
return __fma_rd(a, b, c);
#endif
#else // GPU
#else // CPU
return NextFloatDown(FMA(a, b, c));
#endif
}
Expand Down

0 comments on commit 88645ff

Please sign in to comment.