Skip to content

Commit

Permalink
added DNNL package
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigori Fursin committed Jul 30, 2021
1 parent eee4aed commit 87cc442
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTIONS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Grigori Fursin <grigori@octoml.ai>
Alexander Peskov
1 change: 1 addition & 0 deletions package/.cm/alias-a-lib-dnnl-from-src
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8c9042bdd8c94ce6
1 change: 1 addition & 0 deletions package/.cm/alias-u-8c9042bdd8c94ce6
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib-dnnl-from-src
1 change: 1 addition & 0 deletions package/compiler-tvm-from-src/.cm/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
],
"process_script": "install",
"soft_uoa": "757f02edb31a4008",
"soft_uoa#": "compiler.tvm",
"suggested_path": "compiler-tvm",
"tags": [
"compiler",
Expand Down
1 change: 1 addition & 0 deletions package/lib-dnnl-from-src/.cm/desc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
15 changes: 15 additions & 0 deletions package/lib-dnnl-from-src/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"backup_data_uid": "8c9042bdd8c94ce6",
"backup_module_uid": "1dc07ee0f4742028",
"backup_module_uoa": "package",
"control": {
"engine": "CK",
"iso_datetime": "2021-07-30T08:39:55.024366",
"version": [
"2",
"5",
"8"
]
},
"data_name": "lib-dnnl-from-src"
}
80 changes: 80 additions & 0 deletions package/lib-dnnl-from-src/.cm/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"check_exit_status": "yes",
"customize": {
"install_env": {
"PACKAGE_GIT": "https://github.com/oneapi-src/oneDNN",
"DNNL_BUILD_TESTS": "OFF",
"DNNL_BUILD_EXAMPLES": "OFF",
"DNNL_CPU_RUNTIME": "OMP"
},
"no_ver_in_suggested_path": "yes"
},
"deps": {
"cmake": {
"add_to_path": "no",
"force_target_as_host": "yes",
"local": "yes",
"name": "CMake tool",
"skip_from_bat": "yes",
"sort": 20,
"tags": "tool,cmake",
"version_from": [
3,
18,
0
]
},
"compiler": {
"add_to_path": "no",
"local": "yes",
"name": "C++ compiler",
"sort": 10,
"tags": "compiler,lang-cpp"
}
},
"end_full_path_universal": "install$#sep#$lib$#sep#$libdnnl$#file_ext_dll#$",
"end_full_path": {
"linux": "install/bin/clang"
},
"only_for_host_os_tags": [
"linux"
],
"only_for_target_os_tags": [
"linux"
],
"package_extra_name": " (built from sources)",
"process_script": "install",
"soft_uoa": "7ab0333683daf6db",
"soft_uoa#": "lib.dnnl",
"suggested_path": "lib-dnnl-from-src",
"tags": [
"lib",
"oneapi",
"oneapi-dnnl",
"oneapi-onednn",
"onednn",
"dnnl"
],
"use_preprocess_scripts_from_another_entry": {
"data_uoa": "process-compiler-for-cmake",
"module_uoa": "script"
},
"variations": {
"dev": {
"extra_customize": {
"version": "dev"
},
"extra_env": {
"PACKAGE_GIT_CHECKOUT": "master"
}
},
"v2.2.4": {
"extra_customize": {
"version": "2.2.4"
},
"extra_env": {
"PACKAGE_GIT_CHECKOUT": "v2.2.4"
}
}
}
}
3 changes: 3 additions & 0 deletions package/lib-dnnl-from-src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Customize installation:

ck install packge:lib-dnnl-from-src --env.DNLL_CPU_RUNTIME={OMP | SEQ}
49 changes: 49 additions & 0 deletions package/lib-dnnl-from-src/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#! /bin/bash

# PACKAGE_DIR
# INSTALL_DIR

echo "******************************************************"
cd ${INSTALL_DIR}

if [ ! -d "src" ]; then
git clone -b "${PACKAGE_GIT_CHECKOUT}" ${PACKAGE_GIT} src
if [ "${?}" != "0" ]; then exit 1; fi
fi

mkdir -p install
mkdir -p build

echo "******************************************************"
cd build
${CK_ENV_TOOL_CMAKE_BIN}/cmake .. \
-DCMAKE_CXX_COMPILER="${CK_CXX_PATH_FOR_CMAKE}" \
-DCMAKE_CXX_FLAGS="${CK_CXX_FLAGS_FOR_CMAKE} ${EXTRA_FLAGS}" \
-DCMAKE_C_COMPILER="${CK_CC_PATH_FOR_CMAKE}" \
-DCMAKE_C_FLAGS="${CK_CC_FLAGS_FOR_CMAKE} ${EXTRA_FLAGS}" \
-DCMAKE_AR="${CK_AR_PATH_FOR_CMAKE}" \
-DCMAKE_LINKER="${CK_LD_PATH_FOR_CMAKE}" \
-DCMAKE_RANLIB="${CK_RANLIB_PATH_FOR_CMAKE}" \
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}/install" \
-DCMAKE_BUILD_TYPE=Release \
-DDNNL_BUILD_TESTS=${DNNL_BUILD_TESTS} \
-DDNNL_BUILD_EXAMPLES=${DNNL_BUILD_EXAMPLES} \
-DDNNL_CPU_RUNTIME=${DNNL_CPU_RUNTIME} \
../src/
if [ "${?}" != "0" ]; then exit 1; fi

echo "******************************************************"
cmake --build . -j${CK_HOST_CPU_NUMBER_OF_PROCESSORS}
if [ "${?}" != "0" ]; then exit 1; fi

echo "******************************************************"
cmake --install .
if [ "${?}" != "0" ]; then exit 1; fi


# Clean build directory (too large)
cd ${INSTALL_DIR}
rm -rf build

echo "******************************************************"
echo "LLVM was built and installed to ${INSTALL_DIR}/install ..."

0 comments on commit 87cc442

Please sign in to comment.