Skip to content

Commit

Permalink
explicit template instantiations
Browse files Browse the repository at this point in the history
  • Loading branch information
williamberman committed Nov 3, 2022
1 parent 7b95fe7 commit 0bf5e99
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/parallel_ops/partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,35 @@ void Repartition::backward_kernel(const T *output_grad_ptr,

RepartitionMeta::RepartitionMeta(FFHandler handler) : OpMeta(handler) {}

// float
template void Repartition::forward_kernel<float>(float const *input_ptr,
float *output_ptr,
size_t num_elements);
template void Repartition::backward_kernel<float>(float const *output_grad_ptr,
float *input_grad_ptr,
size_t num_elements);
// double
template void Repartition::forward_kernel<double>(double const *input_ptr,
double *output_ptr,
size_t num_elements);
template void Repartition::backward_kernel<double>(double const *output_grad_ptr,
double *input_grad_ptr,
size_t num_elements);

// int
template void Repartition::forward_kernel<int>(int const *input_ptr,
int *output_ptr,
size_t num_elements);
template void Repartition::backward_kernel<int>(int const *output_grad_ptr,
int *input_grad_ptr,
size_t num_elements);

// long
template void Repartition::forward_kernel<long>(long const *input_ptr,
long *output_ptr,
size_t num_elements);
template void Repartition::backward_kernel<long>(long const *output_grad_ptr,
long *input_grad_ptr,
size_t num_elements);

}; // namespace FlexFlow
2 changes: 2 additions & 0 deletions src/runtime/accessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,11 @@ GenericTensorAccessorW

#define DIMFUNC(DIM) \
template class TensorAccessorR<float, DIM>; \
template class TensorAccessorR<double, DIM>; \
template class TensorAccessorR<int32_t, DIM>; \
template class TensorAccessorR<int64_t, DIM>; \
template class TensorAccessorW<float, DIM>; \
template class TensorAccessorW<double, DIM>; \
template class TensorAccessorW<int32_t, DIM>; \
template class TensorAccessorW<int64_t, DIM>;
LEGION_FOREACH_N(DIMFUNC)
Expand Down

0 comments on commit 0bf5e99

Please sign in to comment.