Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nvcc compilation with MSVC #334

Merged
merged 1 commit into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/llama/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#ifndef LLAMA_LAMBDA_INLINE_WITH_SPECIFIERS
# if defined(__clang__) || defined(__INTEL_LLVM_COMPILER)
# define LLAMA_LAMBDA_INLINE_WITH_SPECIFIERS(...) __attribute__((always_inline)) __VA_ARGS__
# elif defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__NVCC__)
# elif defined(__GNUC__) || defined(__INTEL_COMPILER) || (defined(__NVCC__) && !defined(_MSC_VER))
# define LLAMA_LAMBDA_INLINE_WITH_SPECIFIERS(...) __VA_ARGS__ __attribute__((always_inline))
# elif defined(_MSC_VER)
# define LLAMA_LAMBDA_INLINE_WITH_SPECIFIERS(...) \
Expand Down
5 changes: 2 additions & 3 deletions include/llama/mapping/AoS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ namespace llama::mapping
{
constexpr std::size_t flatIndex =
#ifdef __NVCC__
Flattener{}.template flatIndex<RecordCoords...>;
#else
Flattener::template flatIndex<RecordCoords...>;
*& // mess with nvcc compiler state to workaround bug
#endif
Flattener::template flatIndex<RecordCoords...>;
const auto offset
= LinearizeArrayDimsFunctor{}(coord, arrayDimsSize)
* flatSizeOf<
Expand Down
5 changes: 2 additions & 3 deletions include/llama/mapping/One.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ namespace llama::mapping
{
constexpr std::size_t flatIndex =
#ifdef __NVCC__
Flattener{}.template flatIndex<RecordCoords...>;
#else
Flattener::template flatIndex<RecordCoords...>;
*& // mess with nvcc compiler state to workaround bug
#endif
Flattener::template flatIndex<RecordCoords...>;
constexpr auto offset = flatOffsetOf<typename Flattener::FlatRecordDim, flatIndex, AlignAndPad>;
return {0, offset};
}
Expand Down