Skip to content

Commit

Permalink
Fix dr::gather of non-jit array with scalar indices (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
YunHsiao authored Dec 12, 2024
1 parent 528f142 commit 812f15e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/drjit/array_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 984,9 @@ Target gather(Source &&source, const Index &index, const Mask &mask_ = true,
static_assert(size_v<Source> == size_v<Target>,
"When gathering from a nested array source, the source "
"and target types must be compatible!");
using Index2 = plain_t<replace_scalar_t<Target, scalar_t<Index>>>;
using Index2 = std::conditional_t<is_array_v<Index>,
plain_t<replace_scalar_t<Target, scalar_t<Index>>>,
plain_t<replace_value_t<Target, Index>>>;
Target result;
if constexpr (Target::Size == Dynamic)
result = empty<Target>(source.size());
Expand Down

0 comments on commit 812f15e

Please sign in to comment.