##
# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
#
# Author:    Stephane Thiell <sthiell@stanford.edu>
##
easyblock = 'Tarball'

name = 'cuDNN'
version = '7.0.2'
cuda_version = '9.0.176'

cuda_version_major_minor = '.'.join(cuda_version.split('.')[:2])

versionsuffix = '-CUDA-%s' % cuda_version

homepage = 'https://developer.nvidia.com/cudnn'
description = """The NVIDIA CUDA Deep Neural Network library (cuDNN) is a GPU-accelerated library of primitives for
    deep neural networks."""

toolchain = {'name': 'dummy', 'version': 'dummy'}

# Nvidia developer registration required.
# Download link: https://developer.nvidia.com/rdp/cudnn-download
# Download as cudnn-9.0-linux-x64-v7.tgz, rename to cudnn-9.0-linux-x64-v7.0.2.tgz
sources = ['%%(namelower)s-%s-linux-x64-v%%(version)s.tgz' % cuda_version_major_minor]
checksums = ['ec2a89453ef6454d417b7f3dad67405e30953e1df1e47aafb846f99d02eaa5d1']

dependencies = [('CUDA', cuda_version)]

sanity_check_paths = {
    'files': ['include/cudnn.h', 'lib64/libcudnn_static.a'],
    'dirs': ['include', 'lib64'],
}

moduleclass = 'numlib'
