# IT4Innovations 2022
# JK

easyblock = 'MakeCp'

name = 'gpu_burn'
version = '1.1'
local_cudaversion = '11.6.0'
local_commit = 'c535b67'
versionsuffix = "-CUDA-%s" % local_cudaversion

homepage = 'http://wili.cc/blog/gpu-burn.html'
description = """Multi-GPU CUDA stress test"""

toolchain = {'name': 'NVHPC', 'version': '22.2'}
toolchainopts = {'opt': False}

source_urls = ['https://github.com/wilicc/gpu-burn/archive']
sources = [{'download_filename': '%s.tar.gz' % local_commit, 'filename': SOURCE_TAR_GZ}]
checksums = [
    '2dec738c935642395e15bd6ce71a14f8307c86661b3c8bc3826ff0272abf8f20',  # gpu_burn-1.1.tar.gz
]

dependencies = [('OpenMPI', '4.1.2', versionsuffix)]

build_cmd = 'unset CFLAGS; make COMPUTE=8.0 CUDAPATH=${EBROOTCUDACORE}'

files_to_copy = ['gpu_burn', 'gpu_burn-drv.o', 'compare.ptx', 'gpu_burn-drv.cpp', 'compare.cu']

sanity_check_paths = {
    'files': ['gpu_burn'],
    'dirs': []
}

modluafooter = """
add_property('arch', 'gpu')
"""

modextrapaths = {'PATH': '.'}

parallel = 1 

moduleclass = 'tools'
