Skip to content

Commit

Permalink
fix for cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
alifahrri committed Mar 29, 2024
1 parent 887f869 commit fe899c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion include/nmtools/array/functional/functor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace nmtools::functional
, "the return of apply function is invalid!" );
}
return result;
}
} // apply_function

/**
* @brief Type constructor to compose functors.
Expand Down Expand Up @@ -149,6 +149,7 @@ namespace nmtools::functional
}; // functor_composition_t

template <template<typename...>typename tuple, typename...functors_t>
nmtools_func_attribute
functor_composition_t(const tuple<functors_t...>&) -> functor_composition_t<tuple<functors_t...>>;

/**
Expand Down Expand Up @@ -249,6 +250,7 @@ namespace nmtools::functional
}; // functor_t

template <typename F>
nmtools_func_attribute
functor_t(const F) -> functor_t<F,meta::empty_operands_t,meta::empty_attributes_t>;

template <template<typename...>typename left_tp, typename...left_functors_t, typename left_operands_t
Expand Down Expand Up @@ -412,6 +414,7 @@ namespace nmtools::functional
}; // apply_function_t<functor_composition_t<...>>

template <typename F>
nmtools_func_attribute // host device
apply_function_t(const F&) -> apply_function_t<F>;

template <typename F, nm_size_t Arity, nm_size_t N_OUT=1>
Expand Down
6 changes: 3 additions & 3 deletions include/nmtools/platform/cuda.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef NMTOOLS_PLATFOM_CUDA_HPP
#define NMTOOLS_PLATFOM_CUDA_HPP
#ifndef NMTOOLS_PLATFORM_CUDA_HPP
#define NMTOOLS_PLATFORM_CUDA_HPP

#define nmtools_func_attribute __host__ __device__

Expand All @@ -19,4 +19,4 @@
#define NMTOOLS_DISABLE_STL
#endif

#endif // NMTOOLS_PLATFOM_CUDA_HPP
#endif // NMTOOLS_PLATFORM_CUDA_HPP

0 comments on commit fe899c3

Please sign in to comment.