Skip to content

Commit

Permalink
Update test following cms-sw#28537
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel authored and fwyzard committed Mar 5, 2020
1 parent 2123cc3 commit b37dddb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion DataFormats/DetId/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<iftool name="cuda-gcc-support">
<bin name="test_detid" file="test_detid.cu">
<use name="DataFormats/DetId"/>
<use name="cuda"/>
<use name="DataFormats/DetId"/>
<use name="HeterogeneousCore/CUDAUtilities"/>
</bin>
</iftool>
15 changes: 7 additions & 8 deletions DataFormats/DetId/test/test_detid.cu
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#include <cuda_runtime.h>
#include <cassert>
#include <iostream>

#include <cuda.h>
#include <cuda_runtime.h>

#include <iostream>
#include <assert.h>
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "HeterogeneousCore/CUDAUtilities/interface/requireDevices.h"

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

int main(int argc, char** argv) {
int nDevices;
cudaGetDeviceCount(&nDevices);
std::cout << "nDevices = " << nDevices << std::endl;
cms::cudatest::requireDevices();

// test det id functionality
if (nDevices > 0)
test_detid();
test_detid();
}

0 comments on commit b37dddb

Please sign in to comment.