Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 75413b7

Browse files
Create Halide_Experimental building script
This PR temporarily introduces a Halide hack to make progress. After a quick exchange with @abadams this seems unnecessary as the use case for sequential dependencies probably only requires an RDom instead of a Var for the `t` for-loop index. Punting for now.
1 parent bd7c15b commit 75413b7

File tree

6 files changed

+132
-3
lines changed

6 files changed

+132
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
command: |
1414
. /opt/conda/anaconda/bin/activate
1515
source activate tc_build
16-
conda install -y -c nicolasvasilache llvm-trunk halide
16+
conda install -y -c nicolasvasilache llvm-trunk halide_experimental
1717
1818
- run:
1919
name: check_formatting

.jenkins/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ cd /var/lib/jenkins/workspace
6060
git submodule update --init --recursive
6161

6262
source activate tc_build
63-
conda install -y -c nicolasvasilache llvm-trunk halide
63+
conda install -y -c nicolasvasilache llvm-trunk halide_experimental
6464
conda install -y -c conda-forge eigen
6565
conda install -y -c nicolasvasilache caffe2
6666

conda_recipes/conda_build_tc.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ time conda build -c $ANACONDA_USER --python 3.6 halide
6464

6565
echo "HALIDE packaged Successfully"
6666

67+
##############################################################################
68+
# Halide_Experimental settings
69+
HALIDE_EXPERIMENTAL_BUILD_VERSION="1.0.0"
70+
HALIDE_EXPERIMENTAL_BUILD_NUMBER=1
71+
HALIDE_EXPERIMENTAL_GIT_HASH="0c6f23c9c7b17a82718ffee69b6360483302d63a"
72+
73+
echo "Packaging HALIDE_EXPERIMENTAL ==> HALIDE_EXPERIMENTAL_BUILD_VERSION: ${HALIDE_EXPERIMENTAL_BUILD_VERSION} HALIDE_EXPERIMENTAL_BUILD_NUMBER: ${HALIDE_EXPERIMENTAL_BUILD_NUMBER}"
74+
75+
export HALIDE_EXPERIMENTAL_BUILD_VERSION=$HALIDE_EXPERIMENTAL_BUILD_VERSION
76+
export HALIDE_EXPERIMENTAL_BUILD_NUMBER=$HALIDE_EXPERIMENTAL_BUILD_NUMBER
77+
export HALIDE_EXPERIMENTAL_GIT_HASH=$HALIDE_EXPERIMENTAL_GIT_HASH
78+
79+
time conda build -c $ANACONDA_USER --python 3.6 halide_experimental
80+
81+
echo "HALIDE_EXPERIMENTAL packaged Successfully"
82+
6783
################################################################################
6884
## Tensor Comprehensions settings
6985
#TC_BUILD_VERSION="0.2.0"

conda_recipes/halide/build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,17 @@ LLVM_CONFIG=${LLVM_CONFIG} \
5252
VERBOSE=${VERBOSE} \
5353
PREFIX=${INSTALL_PREFIX} \
5454
WITH_LLVM_INSIDE_SHARED_LIBHALIDE= \
55+
WITH_X86=1 \
56+
WITH_ARM= \
57+
WITH_HEXAGON= \
58+
WITH_MIPS= \
59+
WITH_AARCH64= \
60+
WITH_POWERPC= \
61+
WITH_PTX=1 \
62+
WITH_AMDGPU= \
5563
WITH_OPENCL= \
56-
WITH_OPENGL= \
5764
WITH_METAL= \
65+
WITH_OPENGL= \
5866
WITH_EXCEPTIONS=1 \
5967
make -f ../Makefile -j"$(nproc)" install || exit 1
6068
mkdir -p ${INSTALL_PREFIX}/include/Halide
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# code gets checked out at below:
6+
# $SOURCE_DIR ===> <anaconda_root>/conda-bld/halide_experimental_<timestamp>/work
7+
#
8+
# build directory gets created at $SOURCE_DIR/build
9+
#
10+
# CONDA environment for debugging:
11+
# cd <anaconda_root>/conda-bld/halide_experimental_<timestamp>
12+
# source activate ./_h_env_...... # long placeholders
13+
#
14+
# $CONDA_PREFIX and $PREFIX are set to the same value i.e. the environment value
15+
#
16+
# Installation happens in the $PREFIX which is the environment and rpath is set
17+
# to that
18+
#
19+
# For tests, a new environment _test_env_.... is created
20+
# During the tests, you will see that the halide_experimental package gets checked out
21+
22+
CMAKE_VERSION=${CMAKE_VERSION:="`which cmake3 || which cmake`"}
23+
VERBOSE=${VERBOSE:=0}
24+
25+
CC=${CC:="`which gcc`"}
26+
CXX=${CXX:="`which g++`"}
27+
28+
export INSTALL_PREFIX=$PREFIX
29+
echo "CONDA_PREFIX: ${CONDA_PREFIX}"
30+
echo "PREFIX: ${PREFIX}"
31+
32+
export CLANG_PREFIX=$($PREFIX/bin/llvm-config --prefix)
33+
echo "CLANG_PREFIX: ${CLANG_PREFIX}"
34+
35+
echo "Building Halide_Experimental conda package"
36+
37+
echo "Clean up existing build packages if any"
38+
rm -rf build || true
39+
40+
mkdir -p build
41+
cd build
42+
43+
echo "Configuring Halide_Experimental"
44+
45+
LLVM_CONFIG_FROM_PREFIX=${CLANG_PREFIX}/bin/llvm-config
46+
LLVM_CONFIG=$( which $LLVM_CONFIG_FROM_PREFIX || which llvm-config-4.0 || which llvm-config )
47+
CLANG_FROM_PREFIX=${CLANG_PREFIX}/bin/clang
48+
CLANG=$( which $CLANG_FROM_PREFIX || which clang-4.0 || which clang )
49+
50+
CLANG=${CLANG} \
51+
LLVM_CONFIG=${LLVM_CONFIG} \
52+
VERBOSE=${VERBOSE} \
53+
PREFIX=${INSTALL_PREFIX} \
54+
WITH_LLVM_INSIDE_SHARED_LIBHALIDE= \
55+
WITH_X86=1 \
56+
WITH_ARM= \
57+
WITH_HEXAGON= \
58+
WITH_MIPS= \
59+
WITH_AARCH64= \
60+
WITH_POWERPC= \
61+
WITH_PTX=1 \
62+
WITH_AMDGPU= \
63+
WITH_OPENCL= \
64+
WITH_METAL= \
65+
WITH_OPENGL= \
66+
WITH_EXCEPTIONS=1 \
67+
make -f ../Makefile -j"$(nproc)" install || exit 1
68+
mkdir -p ${INSTALL_PREFIX}/include/Halide
69+
mv ${INSTALL_PREFIX}/include/Halide*.h ${INSTALL_PREFIX}/include/Halide/ || exit 1
70+
71+
echo "Successfully built Halide_Experimental conda package"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package:
2+
name: halide_experimental
3+
version: "{{ environ.get('HALIDE_EXPERIMENTAL_BUILD_VERSION') }}"
4+
5+
source:
6+
git_url: https://github.com/nicolasvasilache/Halide.git
7+
git_rev: "{{ environ.get('HALIDE_EXPERIMENTAL_GIT_HASH') }}"
8+
9+
requirements:
10+
build:
11+
- llvm-trunk==1.0.0
12+
- cmake
13+
run:
14+
- llvm-trunk==1.0.0
15+
- cmake
16+
17+
build:
18+
number: {{ environ.get('HALIDE_EXPERIMENTAL_BUILD_NUMBER') }}
19+
skip: True # [win]
20+
21+
test:
22+
commands:
23+
- test -f $PREFIX/lib/libHalide.so
24+
- test -f $PREFIX/lib/libHalide.a
25+
- test -d $PREFIX/include/Halide
26+
27+
about:
28+
home: http://halide-lang.org
29+
license: MIT
30+
summary: A language for image processing and computational photography
31+
32+
extra:
33+
recipe-maintainers:
34+
- nicolasvasilache

0 commit comments

Comments
 (0)