Skip to content

Commit

Permalink
Merge branch 'master' into portable_glm
Browse files Browse the repository at this point in the history
  • Loading branch information
ptheywood authored Jul 31, 2023
2 parents 41f6ac5 + 16813e2 commit f6d6b20
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Draft-Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ jobs:
done
echo "files: ${files}"
# Set the list of files as the output for this step
echo "::set-output name=files::${files}"
echo "files=${files}" >> "$GITHUB_OUTPUT"
# Extract information from the tag which is required for the draft github release
- name: Process Tag
Expand All @@ -622,9 +622,9 @@ jobs:
prerelease_label_len=$(echo ${prerelease_label} | wc -c)
prerelease_flag=$([[ -z "${prerelease_label_len}" ]] && echo "" || echo "--prerelease")
# set step outputs
echo "::set-output name=tag::${tag}"
echo "::set-output name=version::${version}"
echo "::set-output name=prerelease_flag::${prerelease_flag}"
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "prerelease_flag=${prerelease_flag}" >> "$GITHUB_OUTPUT"
# Use the gh cli tool to create a draft release
# @future - use --notes "notes string" or --notes-file file
Expand Down
14 changes: 10 additions & 4 deletions src/flamegpu/detail/compute_capability.cu
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,23 @@ const std::string compute_capability::getDeviceName(int deviceIndex) {
const std::string compute_capability::getDeviceNames(std::set<int> devices) {
std::string device_names;
bool first = true;
// Get the count of devices
int deviceCount = 0;
gpuErrchk(cudaGetDeviceCount(&deviceCount));
// If no devices were passed in, add each device to the set of devices.
if (devices.size() == 0) {
for (int i = 0; i < deviceCount; i++) {
devices.emplace_hint(devices.end(), i);
}
}
for (int device_id : devices) {
// Throw an exception if the deviceIndex is negative.
if (device_id < 0) {
THROW exception::InvalidCUDAdevice();
}

// Ensure deviceIndex is valid.
int deviceCount = 0;
gpuErrchk(cudaGetDeviceCount(&deviceCount));
if (device_id >= deviceCount) {
// Throw an excpetion if the device index is bad.
// Throw an exception if the device index is bad.
THROW exception::InvalidCUDAdevice();
}
// Load device properties
Expand Down
5 changes: 4 additions & 1 deletion src/flamegpu/simulation/CUDAEnsemble.cu
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,12 @@ unsigned int CUDAEnsemble::simulate(const RunPlanVector &plans) {
std::map<std::string, std::string> payload_items;
payload_items["GPUDevices"] = flamegpu::detail::compute_capability::getDeviceNames(config.devices);
payload_items["SimTime(s)"] = std::to_string(ensemble_elapsed_time);
#if defined(__CUDACC_VER_MAJOR__) && defined(__CUDACC_VER_MINOR__) && defined(__CUDACC_VER_PATCH__)
#if defined(__CUDACC_VER_MAJOR__) && defined(__CUDACC_VER_MINOR__) && defined(__CUDACC_VER_BUILD__)
payload_items["NVCCVersion"] = std::to_string(__CUDACC_VER_MAJOR__) + "." + std::to_string(__CUDACC_VER_MINOR__) + "." + std::to_string(__CUDACC_VER_BUILD__);
#endif
// Add the ensemble size to the ensemble telemetry payload
payload_items["PlansSize"] = std::to_string(plans.size());
payload_items["ConcurrentRuns"] = std::to_string(config.concurrent_runs);
// generate telemetry data
std::string telemetry_data = flamegpu::io::Telemetry::generateData("ensemble-run", payload_items, isSWIG);
// send the telemetry packet
Expand Down
2 changes: 1 addition & 1 deletion src/flamegpu/simulation/CUDASimulation.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ void CUDASimulation::simulate() {
std::map<std::string, std::string> payload_items;
payload_items["GPUDevices"] = flamegpu::detail::compute_capability::getDeviceName(deviceInitialised);
payload_items["SimTime(s)"] = std::to_string(elapsedSecondsSimulation);
#if defined(__CUDACC_VER_MAJOR__) && defined(__CUDACC_VER_MINOR__) && defined(__CUDACC_VER_PATCH__)
#if defined(__CUDACC_VER_MAJOR__) && defined(__CUDACC_VER_MINOR__) && defined(__CUDACC_VER_BUILD__)
payload_items["NVCCVersion"] = std::to_string(__CUDACC_VER_MAJOR__) + "." + std::to_string(__CUDACC_VER_MINOR__) + "." + std::to_string(__CUDACC_VER_BUILD__);
#endif
// generate telemtry data
Expand Down

0 comments on commit f6d6b20

Please sign in to comment.