Skip to content

Commit

Permalink
Remove PBRT_CPU_GPU from various CPU-only functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mmp committed Oct 7, 2024
1 parent 5374fba commit 2bae563
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/pbrt/util/taggedptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,19 +358,19 @@ PBRT_CPU_GPU R Dispatch(F &&func, void *ptr, int index) {
}

template <typename F, typename R, typename T>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_EQ(0, index);
return func((const T *)ptr);
}

template <typename F, typename R, typename T>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_EQ(0, index);
return func((T *)ptr);
}

template <typename F, typename R, typename T0, typename T1>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 2);

Expand All @@ -381,7 +381,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
}

template <typename F, typename R, typename T0, typename T1>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 2);

Expand All @@ -392,7 +392,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
}

template <typename F, typename R, typename T0, typename T1, typename T2>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 3);

Expand All @@ -407,7 +407,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
}

template <typename F, typename R, typename T0, typename T1, typename T2>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 3);

Expand All @@ -422,7 +422,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
}

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 4);

Expand All @@ -439,7 +439,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
}

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 4);

Expand All @@ -457,7 +457,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 5);

Expand All @@ -477,7 +477,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 5);

Expand All @@ -497,7 +497,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 6);

Expand All @@ -519,7 +519,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 6);

Expand All @@ -541,7 +541,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 7);

Expand All @@ -565,7 +565,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 7);

Expand All @@ -589,7 +589,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6, typename T7>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 8);

Expand All @@ -615,7 +615,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {

template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6, typename T7>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_GE(index, 0);
DCHECK_LT(index, 8);

Expand All @@ -642,7 +642,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6, typename T7, typename... Ts,
typename = typename std::enable_if_t<(sizeof...(Ts) > 0)>>
PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
auto DispatchCPU(F &&func, const void *ptr, int index) {
DCHECK_GE(index, 0);

switch (index) {
Expand Down Expand Up @@ -670,7 +670,7 @@ PBRT_CPU_GPU auto DispatchCPU(F &&func, const void *ptr, int index) {
template <typename F, typename R, typename T0, typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6, typename T7, typename... Ts,
typename = typename std::enable_if_t<(sizeof...(Ts) > 0)>>
PBRT_CPU_GPU auto DispatchCPU(F &&func, void *ptr, int index) {
auto DispatchCPU(F &&func, void *ptr, int index) {
DCHECK_GE(index, 0);

switch (index) {
Expand Down Expand Up @@ -852,7 +852,7 @@ class TaggedPointer {
}

template <typename F>
PBRT_CPU_GPU decltype(auto) DispatchCPU(F &&func) const {
decltype(auto) DispatchCPU(F &&func) const {
DCHECK(ptr());
using R = typename detail::ReturnTypeConst<F, Ts...>::type;
return detail::DispatchCPU<F, R, Ts...>(func, ptr(), Tag() - 1);
Expand Down

0 comments on commit 2bae563

Please sign in to comment.