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

Rename exitSansCUDADevices to requireCUDADevices #423

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
4 changes: 2 additions & 2 deletions CUDADataFormats/Common/test/test_CUDAProduct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "CUDADataFormats/Common/interface/CUDAProduct.h"
#include "HeterogeneousCore/CUDACore/interface/CUDAScopedContext.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/CUDAStreamCache.h"
#include "HeterogeneousCore/CUDAUtilities/interface/CUDAEventCache.h"

Expand All @@ -30,7 +30,7 @@ TEST_CASE("Use of CUDAProduct template", "[CUDACore]") {
auto bar = std::move(foo);
}

exitSansCUDADevices();
requireCUDADevices();

constexpr int defaultDevice = 0;
cudaCheck(cudaSetDevice(defaultDevice));
Expand Down
4 changes: 2 additions & 2 deletions CUDADataFormats/Track/test/TrajectoryStateSOA_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ __global__ void testTSSoA(TS* pts, int n) {
}

#ifdef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#endif

int main() {
#ifdef __CUDACC__
exitSansCUDADevices();
requireCUDADevices();
#endif

TS ts;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHit2DCUDA.h"
#include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"

namespace testTrackingRecHit2D {
Expand All @@ -10,7 +10,7 @@ namespace testTrackingRecHit2D {
}

int main() {
exitSansCUDADevices();
requireCUDADevices();

cudaStream_t stream;
cudaCheck(cudaStreamCreateWithFlags(&stream, cudaStreamNonBlocking));
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/CaloRecHit/test/test_calo_rechit.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <cuda_runtime.h>

#include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

__global__ void kernel_test_calo_rechit(CaloRecHit* other) {
CaloRecHit rh{DetId(0), 10, 1, 0, 0};
Expand Down Expand Up @@ -43,7 +43,7 @@ void test_calo_rechit() {
}

int main(int argc, char** argv) {
exitSansCUDADevices();
requireCUDADevices();

test_calo_rechit();

Expand Down
4 changes: 2 additions & 2 deletions DataFormats/DetId/test/test_detid.cu
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

__global__ void test_gen_detid(DetId* id, uint32_t const rawid) {
DetId did{rawid};
Expand All @@ -29,7 +29,7 @@ void test_detid() {
}

int main(int argc, char** argv) {
exitSansCUDADevices();
requireCUDADevices();

// test det id functionality
test_detid();
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/GeometrySurface/test/gpuFrameTransformTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "DataFormats/GeometrySurface/interface/GloballyPositioned.h"
#include "DataFormats/GeometrySurface/interface/SOARotation.h"
#include "DataFormats/GeometrySurface/interface/TkRotation.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

void toGlobalWrapper(SOAFrame<float> const *frame,
float const *xl,
Expand All @@ -26,7 +26,7 @@ void toGlobalWrapper(SOAFrame<float> const *frame,
uint32_t n);

int main(void) {
exitSansCUDADevices();
requireCUDADevices();

typedef float T;
typedef TkRotation<T> Rotation;
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/HcalDetId/test/test_hcal_detid.cu
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

__global__ void test_gen_detid(DetId *id) {
DetId did;
Expand Down Expand Up @@ -65,7 +65,7 @@ void test_hcal_detid() {
}

int main(int argc, char **argv) {
exitSansCUDADevices();
requireCUDADevices();

// test det id functionality
test_detid();
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/HcalDigi/test/test_hcal_digi.cu
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
#include "DataFormats/HcalDigi/interface/QIE10DataFrame.h"
#include "DataFormats/HcalDigi/interface/QIE11DataFrame.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

__global__ void kernel_test_hcal_qiesample(HcalQIESample *sample, uint16_t value) {
printf("kernel: testing hcal qie sampel\n");
Expand Down Expand Up @@ -163,7 +163,7 @@ void test_hcal_qie8_hbhedf() {
}

int main(int argc, char **argv) {
exitSansCUDADevices();
requireCUDADevices();

// qie8
test_hcal_qiesample();
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/HcalRecHit/test/test_hcal_reco.cu
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "DataFormats/HcalRecHit/interface/HORecHit.h"
#include "DataFormats/HcalRecHit/interface/HFQIE10Info.h"
#include "DataFormats/HcalRecHit/interface/HBHEChannelInfo.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

template <typename T>
__global__ void kernel_test_hcal_rechits(T *other) {
Expand Down Expand Up @@ -110,7 +110,7 @@ void test_hcal_hbhechinfo() {
}

int main(int argc, char **argv) {
exitSansCUDADevices();
requireCUDADevices();

test_hcal_rechits<HBHERecHit>();
test_hcal_rechits<HFRecHit>();
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/Math/test/CholeskyInvert_t.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "DataFormats/Math/interface/choleskyInversion.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/launch.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaDeviceCount.h"

Expand Down Expand Up @@ -197,7 +197,7 @@ void go(bool soa) {
}

int main() {
exitSansCUDADevices();
requireCUDADevices();

go<2>(false);
go<4>(false);
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/Math/test/cudaAtan2Test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end
#include "DataFormats/Math/interface/approx_atan2.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/launch.h"

constexpr float xmin = -100.001; // avoid 0
Expand Down Expand Up @@ -96,7 +96,7 @@ void go() {
}

int main() {
exitSansCUDADevices();
requireCUDADevices();

try {
go<3>();
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/Math/test/cudaMathTest.cu
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ end
#include "DataFormats/Math/interface/approx_atan2.h"
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/launch.h"

std::mt19937 eng;
Expand Down Expand Up @@ -181,7 +181,7 @@ void go() {
}

int main() {
exitSansCUDADevices();
requireCUDADevices();

try {
go<USEEXP>();
Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDACore/test/testStreamEvent.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <cuda_runtime.h>

#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

namespace {
constexpr int ARRAY_SIZE = 20000000;
Expand All @@ -31,7 +31,7 @@ __global__ void kernel_looping(float *point, unsigned int num) {
}

int main() {
exitSansCUDADevices();
requireCUDADevices();

constexpr bool debug = false;

Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDACore/test/test_CUDAScopedContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "HeterogeneousCore/CUDACore/interface/CUDAScopedContext.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/eventIsOccurred.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/CUDAStreamCache.h"
#include "HeterogeneousCore/CUDAUtilities/interface/CUDAEventCache.h"
#include "HeterogeneousCore/CUDAUtilities/interface/currentDevice.h"
Expand Down Expand Up @@ -39,7 +39,7 @@ namespace {
} // namespace

TEST_CASE("Use of CUDAScopedContext", "[CUDACore]") {
exitSansCUDADevices();
requireCUDADevices();

constexpr int defaultDevice = 0;
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "CUDADataFormats/Common/interface/CUDAProduct.h"
#include "HeterogeneousCore/CUDACore/interface/CUDAScopedContext.h"
#include "HeterogeneousCore/CUDATest/interface/CUDAThing.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"

#include <iostream>
Expand Down Expand Up @@ -59,7 +59,7 @@ process.moduleToTest(process.toTest)
)_"};
edm::test::TestProcessor::Config config{baseConfig};

exitSansCUDADevices();
requireCUDADevices();

constexpr int defaultDevice = 0;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef HeterogeneousCore_CUDAUtilities_requireCUDADevices_h
#define HeterogeneousCore_CUDAUtilities_requireCUDADevices_h

void requireCUDADevices();

#endif // HeterogeneousCore_CUDAUtilities_requireCUDADevices_h
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/src/exitSansCUDADevices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include <cuda_runtime.h>

#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

void exitSansCUDADevices() {
void requireCUDADevices() {
int devices = 0;
auto status = cudaGetDeviceCount(&devices);
if (status != cudaSuccess) {
Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/test/HistoContainer_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <random>

#include "HeterogeneousCore/CUDAUtilities/interface/HistoContainer.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

template <typename T, int NBINS = 128, int S = 8 * sizeof(T), int DELTA = 1000>
void go() {
Expand Down Expand Up @@ -136,7 +136,7 @@ void go() {
}

int main() {
exitSansCUDADevices();
requireCUDADevices();

go<int16_t>();
go<uint8_t, 128, 8, 4>();
Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/test/HistoContainer_t.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/HistoContainer.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaDeviceCount.h"

template <typename T>
Expand Down Expand Up @@ -152,7 +152,7 @@ void go() {
}

int main() {
exitSansCUDADevices();
requireCUDADevices();

go<int16_t>();
go<int8_t>();
Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/test/OneHistoContainer_t.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/HistoContainer.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/launch.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaDeviceCount.h"

Expand Down Expand Up @@ -137,7 +137,7 @@ void go() {
}

int main() {
exitSansCUDADevices();
requireCUDADevices();

go<int16_t>();
go<uint8_t, 128, 8, 4>();
Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/test/OneToManyAssoc_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifdef __CUDACC__
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/currentDevice.h"

#endif
Expand Down Expand Up @@ -99,7 +99,7 @@ __global__ void verifyBulk(Assoc const* __restrict__ assoc, AtomicPairCounter co

int main() {
#ifdef __CUDACC__
exitSansCUDADevices();
requireCUDADevices();
auto current_device = cudautils::currentDevice();
#else
// make sure cuda emulation is working
Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/test/assert_t.cu
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "HeterogeneousCore/CUDAUtilities/interface/cuda_assert.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

__global__ void testIt(int one) { assert(one == 1); }

int main(int argc, char* argv[]) {
exitSansCUDADevices();
requireCUDADevices();

testIt<<<1, 1>>>(argc);
cudaDeviceSynchronize();
Expand Down
4 changes: 2 additions & 2 deletions HeterogeneousCore/CUDAUtilities/test/copyAsync_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
#include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h"
#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h"

TEST_CASE("copyAsync", "[cudaMemTools]") {
exitSansCUDADevices();
requireCUDADevices();

cudaStream_t stream;
cudaCheck(cudaStreamCreateWithFlags(&stream, cudaStreamNonBlocking));
Expand Down
Loading