-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple test to load the AlpakaService
- Loading branch information
Showing
4 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- test the AlpakaService for the CPU serial backend --> | ||
<test name="testAlpakaServiceSerialSync" command="cmsRun ${LOCALTOP}/src/HeterogeneousCore/AlpakaServices/test/testAlpakaServiceSerialSync.py"> | ||
<use name="HeterogeneousCore/AlpakaServices"/> | ||
</test> | ||
|
||
<!-- test the AlpakaService for the CUDA backend --> | ||
<test name="testAlpakaServiceCudaAsync" command="cmsRun ${LOCALTOP}/src/HeterogeneousCore/AlpakaServices/test/testAlpakaServiceCudaAsync.py"> | ||
<!-- dependence only to trigger the unit test when NVIDIA GPU is (expected to be) present --> | ||
<use name="cuda"/> | ||
<use name="HeterogeneousCore/AlpakaServices"/> | ||
</test> | ||
|
||
<!-- test the AlpakaService for the ROCm backend --> | ||
<test name="testAlpakaServiceROCmAsync" command="cmsRun ${LOCALTOP}/src/HeterogeneousCore/AlpakaServices/test/testAlpakaServiceROCmAsync.py"> | ||
<!-- dependence only to trigger the unit test when AMD GPU is (expected to be) present --> | ||
<use name="rocm"/> | ||
<use name="HeterogeneousCore/AlpakaServices"/> | ||
</test> |
55 changes: 55 additions & 0 deletions
55
HeterogeneousCore/AlpakaServices/test/testAlpakaServiceCudaAsync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process( "TEST" ) | ||
|
||
process.options = cms.untracked.PSet( | ||
numberOfThreads = cms.untracked.uint32( 4 ), | ||
numberOfStreams = cms.untracked.uint32( 0 ), | ||
) | ||
|
||
process.load('FWCore.MessageService.MessageLogger_cfi') | ||
process.MessageLogger.CUDAService = {} | ||
process.MessageLogger.AlpakaService = {} | ||
|
||
process.load('HeterogeneousCore.CUDAServices.CUDAService_cfi') | ||
|
||
from HeterogeneousCore.AlpakaServices.AlpakaServiceCudaAsync_cfi import AlpakaServiceCudaAsync as _AlpakaServiceCudaAsync | ||
process.AlpakaServiceCudaAsync = _AlpakaServiceCudaAsync.clone( | ||
verbose = True, | ||
hostAllocator = dict( | ||
binGrowth = 2, | ||
minBin = 8, # 256 bytes | ||
maxBin = 30, # 1 GB | ||
maxCachedBytes = 64*1024*1024*1024, # 64 GB | ||
maxCachedFraction = 0.8, # or 80%, whatever is less | ||
fillAllocations = True, | ||
fillAllocationValue = 0xA5, | ||
fillReallocations = True, | ||
fillReallocationValue = 0x69, | ||
fillDeallocations = True, | ||
fillDeallocationValue = 0x5A, | ||
fillCaches = True, | ||
fillCacheValue = 0x96 | ||
), | ||
deviceAllocator = dict( | ||
binGrowth = 2, | ||
minBin = 8, # 256 bytes | ||
maxBin = 30, # 1 GB | ||
maxCachedBytes = 8*1024*1024*1024, # 8 GB | ||
maxCachedFraction = 0.8, # or 80%, whatever is less | ||
fillAllocations = True, | ||
fillAllocationValue = 0xA5, | ||
fillReallocations = True, | ||
fillReallocationValue = 0x69, | ||
fillDeallocations = True, | ||
fillDeallocationValue = 0x5A, | ||
fillCaches = True, | ||
fillCacheValue = 0x96 | ||
) | ||
) | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32( 0 ) | ||
) |
55 changes: 55 additions & 0 deletions
55
HeterogeneousCore/AlpakaServices/test/testAlpakaServiceROCmAsync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process( "TEST" ) | ||
|
||
process.options = cms.untracked.PSet( | ||
numberOfThreads = cms.untracked.uint32( 4 ), | ||
numberOfStreams = cms.untracked.uint32( 0 ), | ||
) | ||
|
||
process.load('FWCore.MessageService.MessageLogger_cfi') | ||
process.MessageLogger.ROCmService = {} | ||
process.MessageLogger.AlpakaService = {} | ||
|
||
process.load('HeterogeneousCore.ROCmServices.ROCmService_cfi') | ||
|
||
from HeterogeneousCore.AlpakaServices.AlpakaServiceROCmAsync_cfi import AlpakaServiceROCmAsync as _AlpakaServiceROCmAsync | ||
process.AlpakaServiceROCmAsync = _AlpakaServiceROCmAsync.clone( | ||
verbose = True, | ||
hostAllocator = cms.untracked.PSet( | ||
binGrowth = cms.untracked.uint32(2), | ||
minBin = cms.untracked.uint32(8), | ||
maxBin = cms.untracked.uint32(30), | ||
maxCachedBytes = cms.untracked.uint64(0), | ||
maxCachedFraction = cms.untracked.double(0.8), | ||
fillAllocations = cms.untracked.bool(True), | ||
fillAllocationValue = cms.untracked.uint32(165), | ||
fillReallocations = cms.untracked.bool(True), | ||
fillReallocationValue = cms.untracked.uint32(90), | ||
fillDeallocations = cms.untracked.bool(True), | ||
fillDeallocationValue = cms.untracked.uint32(105), | ||
fillCaches = cms.untracked.bool(True), | ||
fillCacheValue = cms.untracked.uint32(150) | ||
), | ||
deviceAllocator = cms.untracked.PSet( | ||
binGrowth = cms.untracked.uint32(2), | ||
minBin = cms.untracked.uint32(8), | ||
maxBin = cms.untracked.uint32(30), | ||
maxCachedBytes = cms.untracked.uint64(0), | ||
maxCachedFraction = cms.untracked.double(0.8), | ||
fillAllocations = cms.untracked.bool(True), | ||
fillAllocationValue = cms.untracked.uint32(165), | ||
fillReallocations = cms.untracked.bool(True), | ||
fillReallocationValue = cms.untracked.uint32(90), | ||
fillDeallocations = cms.untracked.bool(True), | ||
fillDeallocationValue = cms.untracked.uint32(105), | ||
fillCaches = cms.untracked.bool(True), | ||
fillCacheValue = cms.untracked.uint32(150) | ||
) | ||
) | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32( 0 ) | ||
) |
52 changes: 52 additions & 0 deletions
52
HeterogeneousCore/AlpakaServices/test/testAlpakaServiceSerialSync.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process( "TEST" ) | ||
|
||
process.options = cms.untracked.PSet( | ||
numberOfThreads = cms.untracked.uint32( 4 ), | ||
numberOfStreams = cms.untracked.uint32( 0 ), | ||
) | ||
|
||
process.load('FWCore.MessageService.MessageLogger_cfi') | ||
process.MessageLogger.AlpakaService = {} | ||
|
||
from HeterogeneousCore.AlpakaServices.AlpakaServiceSerialSync_cfi import AlpakaServiceSerialSync as _AlpakaServiceSerialSync | ||
process.AlpakaServiceSerialSync = _AlpakaServiceSerialSync.clone( | ||
verbose = True, | ||
hostAllocator = cms.untracked.PSet( | ||
binGrowth = cms.untracked.uint32(2), | ||
minBin = cms.untracked.uint32(8), | ||
maxBin = cms.untracked.uint32(30), | ||
maxCachedBytes = cms.untracked.uint64(0), | ||
maxCachedFraction = cms.untracked.double(0.8), | ||
fillAllocations = cms.untracked.bool(True), | ||
fillAllocationValue = cms.untracked.uint32(165), | ||
fillReallocations = cms.untracked.bool(True), | ||
fillReallocationValue = cms.untracked.uint32(90), | ||
fillDeallocations = cms.untracked.bool(True), | ||
fillDeallocationValue = cms.untracked.uint32(105), | ||
fillCaches = cms.untracked.bool(True), | ||
fillCacheValue = cms.untracked.uint32(150) | ||
), | ||
deviceAllocator = cms.untracked.PSet( | ||
binGrowth = cms.untracked.uint32(2), | ||
minBin = cms.untracked.uint32(8), | ||
maxBin = cms.untracked.uint32(30), | ||
maxCachedBytes = cms.untracked.uint64(0), | ||
maxCachedFraction = cms.untracked.double(0.8), | ||
fillAllocations = cms.untracked.bool(True), | ||
fillAllocationValue = cms.untracked.uint32(165), | ||
fillReallocations = cms.untracked.bool(True), | ||
fillReallocationValue = cms.untracked.uint32(90), | ||
fillDeallocations = cms.untracked.bool(True), | ||
fillDeallocationValue = cms.untracked.uint32(105), | ||
fillCaches = cms.untracked.bool(True), | ||
fillCacheValue = cms.untracked.uint32(150) | ||
) | ||
) | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32( 0 ) | ||
) |