Skip to content

Commit

Permalink
added soft:lib.dnnl
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigori Fursin committed Jul 30, 2021
1 parent bb5de25 commit 90a467d
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
20210730:
* added soft:lib.dnnl

202107026:
* added latest PyTorchVision varations up to 0.10. as asked by users
(package:lib-python-torchvision)
Expand Down
1 change: 1 addition & 0 deletions soft/.cm/alias-a-lib.dnnl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ab0333683daf6db
1 change: 1 addition & 0 deletions soft/.cm/alias-u-7ab0333683daf6db
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib.dnnl
1 change: 1 addition & 0 deletions soft/lib.dnnl/.cm/desc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
20 changes: 20 additions & 0 deletions soft/lib.dnnl/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"backup_data_uid": "7ab0333683daf6db",
"backup_module_uid": "5e1100048ab875d7",
"backup_module_uoa": "soft",
"control": {
"author": "cTuning foundation",
"author_email": "admin@cTuning.org",
"author_webpage": "http://cTuning.org",
"copyright": "See CK COPYRIGHT.txt for copyright details",
"engine": "CK",
"iso_datetime": "2021-07-30T08:18:33.045593",
"license": "See CK LICENSE.txt for licensing details",
"version": [
"2",
"5",
"8"
]
},
"data_name": "lib.dnnl"
}
22 changes: 22 additions & 0 deletions soft/lib.dnnl/.cm/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"auto_detect": "yes",
"customize": {
"check_that_exists": "yes",
"ck_version": 10,
"env_prefix": "CK_ENV_LIB_DNNL",
"limit_recursion_dir_search": {
"linux": 5,
"win": 5
},
"soft_file_universal": "libdnnl$#file_ext_dll#$"
},
"soft_name": "DNNL (oneAPI one DNN) library",
"tags": [
"lib",
"oneapi",
"oneapi-dnnl",
"oneapi-onednn",
"onednn",
"dnnl"
]
}
96 changes: 96 additions & 0 deletions soft/lib.dnnl/customize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer(s): Grigori Fursin
#

import os

##############################################################################
# setup environment setup

def setup(i):
"""
Input: {
cfg - meta of this soft entry
self_cfg - meta of module soft
ck_kernel - import CK kernel module (to reuse functions)
host_os_uoa - host OS UOA
host_os_uid - host OS UID
host_os_dict - host OS meta
target_os_uoa - target OS UOA
target_os_uid - target OS UID
target_os_dict - target OS meta
target_device_id - target device ID (if via ADB)
tags - list of tags used to search this entry
env - updated environment vars from meta
customize - updated customize vars from meta
deps - resolved dependencies for this soft
interactive - if 'yes', can ask questions, otherwise quiet
}
Output: {
return - return code = 0, if successful
> 0, if error
(error) - error text if return > 0
bat - prepared string for bat file
}
"""

import os

# Get variables
ck=i['ck_kernel']
s=''

iv=i.get('interactive','')

cus=i.get('customize',{})
fp=cus.get('full_path','')

hosd=i['host_os_dict']
tosd=i['target_os_dict']

winh=hosd.get('windows_base','')

ienv=cus.get('install_env',{})

env=i['env']
ep=cus['env_prefix']

pl=os.path.dirname(fp)
pi=os.path.dirname(pl)

pinc=os.path.join(pi, 'include')

env[ep]=pi


if pl!='' and os.path.isdir(pl):
env[ep+'_LIB']=pl
cus['path_lib']=pl

if os.path.isdir(pinc):
env[ep+'_INCLUDE']=pinc
cus['path_include']=pinc

r = ck.access({'action': 'lib_path_export_script',
'module_uoa': 'os',
'host_os_dict': hosd,
'lib_path': cus.get('path_lib', '')})
if r['return']>0: return r
s += r['script']

return {'return':0, 'bat':s}

0 comments on commit 90a467d

Please sign in to comment.