Skip to content

Commit

Permalink
Remove some nvcc workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Aug 15, 2023
1 parent 9fa7d7a commit 1ebd961
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/cuda/pitch/pitch.cu
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace llamaex
RecordCoord<RecordCoords...> = {}) const -> NrAndOffset<std::size_t>
{
constexpr std::size_t flatFieldIndex =
#ifdef __NVCC__
#if defined(__NVCC__) && __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ <= 6
*& // mess with nvcc compiler state to workaround bug
#endif
Flattener::template flatIndex<RecordCoords...>;
Expand Down
2 changes: 1 addition & 1 deletion include/llama/Accessors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace llama::accessor
struct Atomic
{
template<typename T>
LLAMA_FN_HOST_ACC_INLINE auto operator()(T& r) const -> std::atomic_ref<T>
LLAMA_FORCE_INLINE auto operator()(T& r) const -> std::atomic_ref<T>
{
return std::atomic_ref<T>{r};
}
Expand Down
9 changes: 1 addition & 8 deletions include/llama/ArrayExtents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,7 @@ namespace llama
template<typename... Args>
ArrayExtents(Args...) -> ArrayExtents<
typename internal::IndexTypeFromArgs<std::size_t, Args...>::type,
// we just use Args to repeat dyn as often as Args is big
#ifdef __NVCC__
(static_cast<std::void_t<Args>>(0),
dyn.operator typename internal::IndexTypeFromArgs<std::size_t, Args...>::type())...
#else
(Args{}, dyn)...
#endif
>;
(Args{}, dyn)...>; // we just use Args to repeat dyn as often as Args is big

static_assert(std::is_trivially_default_constructible_v<ArrayExtents<std::size_t, 1>>);
static_assert(std::is_trivially_copy_constructible_v<ArrayExtents<std::size_t, 1>>);
Expand Down
2 changes: 1 addition & 1 deletion include/llama/mapping/One.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace llama::mapping
using Flattener = FlattenRecordDim<TRecordDim>;
static constexpr std::size_t blobCount = 1;

#ifndef __NVCC__
#if defined(__NVCC__) && __CUDACC_VER_MAJOR__ >= 12
using Base::Base;
#else
constexpr One() = default;
Expand Down
1 change: 1 addition & 0 deletions tests/recorddimension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ TEST_CASE("recorddim.record_with_nontrivial_ctor")
}

# ifndef __NVCC__
// we get this otherwise: error: identifier "_NV_ANON_NAMESPACE::UniqueInt::counter" is undefined in device code
namespace
{
struct UniqueInt
Expand Down

0 comments on commit 1ebd961

Please sign in to comment.