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

Filename shuffle #1007

Merged
merged 2 commits into from
Dec 12, 2022
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,4 @@ For a full list of known issues pleases see the [Issue Tracker](https://github.c
+ Multiple known areas where performance can be improved (e.g. [#449](/~https://github.com/FLAMEGPU/FLAMEGPU2/issues/449), [#402](/~https://github.com/FLAMEGPU/FLAMEGPU2/issues/402))
+ Windows/MSVC builds using CUDA 11.0 may encounter errors when performing incremental builds if the static library has been recompiled. If this presents itself, re-save any `.cu` file in your executable producing project and re-trigger the build.
+ Debug builds under linux with CUDA 11.0 may encounter cuda errors during `validateIDCollisions`. Consider using an alternate CUDA version if this is required ([#569](/~https://github.com/FLAMEGPU/FLAMEGPU2/issues/569)).
+ CUDA 11.0 with GCC 9 may encounter a segmentation fault during compilation of the test suite. Consider using GCC 8 with CUDA 11.0.
+ CUDA 11.0 with GCC 9 may encounter a segmentation fault during compilation of the test suite. Consider using GCC 8 with CUDA 11.0.
10 changes: 5 additions & 5 deletions include/flamegpu/util/Any.h → include/flamegpu/detail/Any.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_ANY_H_
#define INCLUDE_FLAMEGPU_UTIL_ANY_H_
#ifndef INCLUDE_FLAMEGPU_DETAIL_ANY_H_
#define INCLUDE_FLAMEGPU_DETAIL_ANY_H_

#include <cstring>

namespace flamegpu {
namespace util {
namespace detail {

/**
* Minimal std::any replacement, works pre c++17
Expand Down Expand Up @@ -88,7 +88,7 @@ struct Any {
const unsigned int elements;
};

} // namespace util
} // namespace detail
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_ANY_H_
#endif // INCLUDE_FLAMEGPU_DETAIL_ANY_H_
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_CUDAEVENTTIMER_CUH_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_CUDAEVENTTIMER_CUH_
#ifndef INCLUDE_FLAMEGPU_DETAIL_CUDAEVENTTIMER_CUH_
#define INCLUDE_FLAMEGPU_DETAIL_CUDAEVENTTIMER_CUH_

#include <cuda_runtime.h>

#include "flamegpu/util/detail/Timer.h"
#include "flamegpu/detail/Timer.h"
#include "flamegpu/exception/FLAMEGPUException.h"
#include "flamegpu/gpu/detail/CUDAErrorChecking.cuh"
#include "flamegpu/simulation/detail/CUDAErrorChecking.cuh"

namespace flamegpu {
namespace util {
namespace detail {

/**
Expand Down Expand Up @@ -130,7 +129,6 @@ class CUDAEventTimer : public virtual Timer {
};

} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_CUDAEVENTTIMER_CUH_
#endif // INCLUDE_FLAMEGPU_DETAIL_CUDAEVENTTIMER_CUH_
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_JITIFYCACHE_H_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_JITIFYCACHE_H_
#ifndef INCLUDE_FLAMEGPU_DETAIL_JITIFYCACHE_H_
#define INCLUDE_FLAMEGPU_DETAIL_JITIFYCACHE_H_

#include <map>
#include <mutex>
Expand All @@ -18,7 +18,6 @@
using jitify::experimental::KernelInstantiation;

namespace flamegpu {
namespace util {
namespace detail {

/**
Expand Down Expand Up @@ -145,7 +144,6 @@ class JitifyCache {
};

} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_JITIFYCACHE_H_
#endif // INCLUDE_FLAMEGPU_DETAIL_JITIFYCACHE_H_
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_SIGNALHANDLERS_H_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_SIGNALHANDLERS_H_
#ifndef INCLUDE_FLAMEGPU_DETAIL_SIGNALHANDLERS_H_
#define INCLUDE_FLAMEGPU_DETAIL_SIGNALHANDLERS_H_
#include <cstdlib>
#include <csignal>

namespace flamegpu {
namespace util {
namespace detail {
/**
* Signal handlers used to try and produce a clean exit on interrupt
Expand Down Expand Up @@ -34,7 +33,6 @@ static void registerSignalHandlers(){
};

} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_SIGNALHANDLERS_H_
#endif // INCLUDE_FLAMEGPU_DETAIL_SIGNALHANDLERS_H_
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_STATICASSERT_H_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_STATICASSERT_H_
#ifndef INCLUDE_FLAMEGPU_DETAIL_STATICASSERT_H_
#define INCLUDE_FLAMEGPU_DETAIL_STATICASSERT_H_

#include <cstdint>

namespace flamegpu {
namespace util {
namespace detail {
/**
* These are taken from MSVCs std to allow us to perform static assertions
Expand Down Expand Up @@ -75,7 +74,6 @@ struct _Is_IntType
};
} // namespace StaticAssert
} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_STATICASSERT_H_
#endif // INCLUDE_FLAMEGPU_DETAIL_STATICASSERT_H_
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_STEADYCLOCKTIMER_H_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_STEADYCLOCKTIMER_H_
#ifndef INCLUDE_FLAMEGPU_DETAIL_STEADYCLOCKTIMER_H_
#define INCLUDE_FLAMEGPU_DETAIL_STEADYCLOCKTIMER_H_

#include <chrono>

#include "flamegpu/util/detail/Timer.h"
#include "flamegpu/detail/Timer.h"
#include "flamegpu/exception/FLAMEGPUException.h"


namespace flamegpu {
namespace util {
namespace detail {

/**
Expand Down Expand Up @@ -91,7 +90,6 @@ class SteadyClockTimer : public virtual Timer {
};

} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_STEADYCLOCKTIMER_H_
#endif // INCLUDE_FLAMEGPU_DETAIL_STEADYCLOCKTIMER_H_
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_TIMER_H_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_TIMER_H_
#ifndef INCLUDE_FLAMEGPU_DETAIL_TIMER_H_
#define INCLUDE_FLAMEGPU_DETAIL_TIMER_H_


namespace flamegpu {
namespace util {
namespace detail {

/**
Expand Down Expand Up @@ -38,7 +37,6 @@ class Timer {
};

} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_TIMER_H_
#endif // INCLUDE_FLAMEGPU_DETAIL_TIMER_H_
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_COMPUTE_CAPABILITY_CUH_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_COMPUTE_CAPABILITY_CUH_
#ifndef INCLUDE_FLAMEGPU_DETAIL_COMPUTE_CAPABILITY_CUH_
#define INCLUDE_FLAMEGPU_DETAIL_COMPUTE_CAPABILITY_CUH_

#include <vector>
#include <string>
#include <set>

#include "flamegpu/gpu/detail/CUDAErrorChecking.cuh"
#include "flamegpu/simulation/detail/CUDAErrorChecking.cuh"

namespace flamegpu {
namespace util {
namespace detail {
namespace compute_capability {

Expand Down Expand Up @@ -69,7 +68,6 @@ const std::string getDeviceName(int deviceIndex);
const std::string getDeviceNames(std::set<int> devices);
} // namespace compute_capability
} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_COMPUTE_CAPABILITY_CUH_
#endif // INCLUDE_FLAMEGPU_DETAIL_COMPUTE_CAPABILITY_CUH_
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_CUDA_CUH_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_CUDA_CUH_
#ifndef INCLUDE_FLAMEGPU_DETAIL_CUDA_CUH_
#define INCLUDE_FLAMEGPU_DETAIL_CUDA_CUH_

/**
* Collection of cuda related utility methods for internal use.
Expand All @@ -11,7 +11,6 @@
#include "flamegpu/exception/FLAMEGPUException.h"

namespace flamegpu {
namespace util {
namespace detail {
namespace cuda {

Expand Down Expand Up @@ -68,7 +67,7 @@ inline cudaError_t cudaFreeHost(void* devPtr) {
inline bool cuDevicePrimaryContextIsActive(int ordinal) {
// Throw an exception if a negative device ordinal is passed
if (ordinal < 0) {
THROW exception::InvalidCUDAdevice("CUDA Device ordinals must be non-negative integers, in util::detail::cuda::cuDevicePrimaryContextIsActive()");
THROW exception::InvalidCUDAdevice("CUDA Device ordinals must be non-negative integers, in detail::cuda::cuDevicePrimaryContextIsActive()");
}

int deviceCount = 0;
Expand All @@ -78,11 +77,11 @@ inline bool cuDevicePrimaryContextIsActive(int ordinal) {
if (cuErr == CUDA_SUCCESS) {
// If the device count is 0, throw.
if (deviceCount == 0) {
THROW exception::InvalidCUDAdevice("Error no CUDA devices found!, in util::detail::cuda::cuDevicePrimaryContextIsActive()");
THROW exception::InvalidCUDAdevice("Error no CUDA devices found!, in detail::cuda::cuDevicePrimaryContextIsActive()");
}
// If the ordinal is invalid, throw
if (ordinal >= deviceCount) {
THROW exception::InvalidCUDAdevice("Requested CUDA device %d is not valid, only %d CUDA devices available!, in util::detail::cuda::cuDevicePrimaryContextIsActive()", ordinal, deviceCount);
THROW exception::InvalidCUDAdevice("Requested CUDA device %d is not valid, only %d CUDA devices available!, in detail::cuda::cuDevicePrimaryContextIsActive()", ordinal, deviceCount);
}
// Get the CUdevice handle, silently dismissing any cuErrors as they are falsey
CUdevice deviceHandle;
Expand All @@ -103,7 +102,6 @@ inline bool cuDevicePrimaryContextIsActive(int ordinal) {

} // namespace cuda
} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_CUDA_CUH_
#endif // INCLUDE_FLAMEGPU_DETAIL_CUDA_CUH_
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_CURAND_CUH_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_CURAND_CUH_
#ifndef INCLUDE_FLAMEGPU_DETAIL_CURAND_CUH_
#define INCLUDE_FLAMEGPU_DETAIL_CURAND_CUH_

/**
* This header exists to allow a convenient way to switch between curand implementations
Expand All @@ -8,7 +8,6 @@
#include <curand_kernel.h>

namespace flamegpu {
namespace util {
namespace detail {

#if defined(FLAMEGPU_CURAND_MRG32k3a)
Expand All @@ -20,7 +19,6 @@ typedef curandStatePhilox4_32_10_t curandState;
#endif

} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_CURAND_CUH_
#endif // INCLUDE_FLAMEGPU_DETAIL_CURAND_CUH_
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_CXXNAME_HPP_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_CXXNAME_HPP_
#ifndef INCLUDE_FLAMEGPU_DETAIL_CXXNAME_HPP_
#define INCLUDE_FLAMEGPU_DETAIL_CXXNAME_HPP_

#include <string>

namespace flamegpu {
namespace util {
namespace detail {
namespace cxxname {

Expand All @@ -26,7 +25,6 @@ inline std::string getUnqualifiedName(std::string qualified) {

} // namespace cxxname
} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_CXXNAME_HPP_
#endif // INCLUDE_FLAMEGPU_DETAIL_CXXNAME_HPP_
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_TYPE_DECODE_H_
#define INCLUDE_FLAMEGPU_UTIL_TYPE_DECODE_H_
#ifndef INCLUDE_FLAMEGPU_DETAIL_TYPE_DECODE_H_
#define INCLUDE_FLAMEGPU_DETAIL_TYPE_DECODE_H_

namespace flamegpu {
namespace detail {

/**
* This struct allows us to natively decode GLM types to their type + length
Expand Down Expand Up @@ -33,4 +36,7 @@ struct type_decode<glm::vec<N, T, Q>> {
};
#endif

#endif // INCLUDE_FLAMEGPU_UTIL_TYPE_DECODE_H_
} // namespace detail
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_DETAIL_TYPE_DECODE_H_
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#ifndef INCLUDE_FLAMEGPU_UTIL_DETAIL_WDDM_CUH_
#define INCLUDE_FLAMEGPU_UTIL_DETAIL_WDDM_CUH_
#ifndef INCLUDE_FLAMEGPU_DETAIL_WDDM_CUH_
#define INCLUDE_FLAMEGPU_DETAIL_WDDM_CUH_

namespace flamegpu {
namespace util {
namespace detail {
namespace wddm {

Expand All @@ -28,7 +27,6 @@ bool deviceIsWDDM();

} // namespace wddm
} // namespace detail
} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DETAIL_WDDM_CUH_
#endif // INCLUDE_FLAMEGPU_DETAIL_WDDM_CUH_
6 changes: 3 additions & 3 deletions include/flamegpu/exception/FLAMEGPUDeviceException.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <string>
#include <type_traits>

#include "flamegpu/gpu/CUDAScanCompaction.h"
#include "flamegpu/simulation/detail/CUDAScanCompaction.h"

#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS

Expand Down Expand Up @@ -40,12 +40,12 @@ class DeviceExceptionManager {
* 1 per stream
* nullptr until used
*/
DeviceExceptionBuffer *d_buffer[CUDAScanCompaction::MAX_STREAMS];
DeviceExceptionBuffer *d_buffer[detail::CUDAScanCompaction::MAX_STREAMS];
/**
* Host buffers to copy error buffers back to
* 1 per stream
*/
DeviceExceptionBuffer hd_buffer[CUDAScanCompaction::MAX_STREAMS];
DeviceExceptionBuffer hd_buffer[detail::CUDAScanCompaction::MAX_STREAMS];
};
} // namespace exception
} // namespace flamegpu
Expand Down
2 changes: 1 addition & 1 deletion include/flamegpu/exception/FLAMEGPUException.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ DERIVED_FLAMEGPUException(InvalidFilePath, "File does not exist.");
*/
DERIVED_FLAMEGPUException(FileAlreadyExists, "File already existst.");
/**
* Defines an exception indicating that the flamegpu::util::detail::Timer has been used incorrectly.
* Defines an exception indicating that the flamegpu::detail::Timer has been used incorrectly.
*/
DERIVED_FLAMEGPUException(TimerException, "Invalid use of Timer");
/**
Expand Down
Loading