diff --git a/.github/workflows/compile-halide-cpp.yml b/.github/workflows/compile-halide-cpp.yml index e849f55..2089e2c 100644 --- a/.github/workflows/compile-halide-cpp.yml +++ b/.github/workflows/compile-halide-cpp.yml @@ -5,7 +5,7 @@ name: Compile Halide C++ on Windows/Linux on: push: - branches: [ master ] + branches: [ master, validate-halide-compile-windows ] pull_request: types: [edited, submitted] @@ -15,29 +15,25 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, ubuntu-latest, windows-latest, macos-latest] + #os: [ubuntu-20.04, ubuntu-latest, windows-latest, macos-latest] + os: [windows-latest] # TODO(Antony): add Python 3.9 to test the Meson build system support - python-version: [3.8] + python-version: ["3.10"] steps: - name: Fetch sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install gcc toolchain run: sudo apt-get install build-essential if: startsWith(matrix.os, 'ubuntu') == true - - name: Install MSVC toolchain - uses: bus1/cabuild/action/msdevshell@v1 - with: - architecture: x64 - if: startsWith(matrix.os, 'windows') == true - - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -49,18 +45,19 @@ jobs: key: ${{ runner.os }}-meson-cache path: proximal/halide/subprojects/packagecache/ - - name: Resolve C++ build dependencies + - name: Resolve C++ build dependencies (non-Windows) run: meson setup proximal/halide proximal/halide/build + if: startsWith(matrix.os, 'window') == false + - name: Resolve C++ build dependencies (msvc toolchain) + run: meson setup --vsenv proximal/halide proximal/halide/build + if: startsWith(matrix.os, 'window') == true + - name: Build ProxImaL-codegen - run: ninja -C proximal/halide/build ladmm-runtime - # TODO(Antony): Resolve "missing DLLs" in Windows Docker environment. - if: startsWith(matrix.os, 'window') == false + run: meson compile -C proximal/halide/build ladmm-runtime:alias - name: Build Python interfaces - run: ninja -C proximal/halide/build python_interface - if: startsWith(matrix.os, 'window') == false + run: meson compile -C proximal/halide/build python_interface - name: Run test suite - run: ninja -C proximal/halide/build test - if: startsWith(matrix.os, 'window') == false + run: meson test -C proximal/halide/build --suite codegen diff --git a/proximal/halide/meson.build b/proximal/halide/meson.build index d14a3a8..8c4ea91 100644 --- a/proximal/halide/meson.build +++ b/proximal/halide/meson.build @@ -125,15 +125,16 @@ if get_option('build_nlm') } endif - if build_machine.system() == 'windows' - env = { 'PATH': halide_library_path } + env = { 'PATH': halide_toolchain.get_variable('halide_dll_path')} object_file_ext = 'obj' statlib_file_ext = 'lib' + dynamiclib_file_ext = 'dll' else env = { 'LD_LIBRARY_PATH': halide_library_path } object_file_ext = 'o' statlib_file_ext = 'a' + dynamiclib_file_ext = 'so' endif proximal_python_interface = [] @@ -154,21 +155,21 @@ foreach p : pipeline_name if cuda_toolchain.found() and p['autoschedule'] compile_cmd += [ 'target=host-cuda', - '-p', 'autoschedule_li2018', - 'autoscheduler=Li2018', - 'autoscheduler.parallelism=32', + #'-p', 'autoschedule_li2018', + #'autoscheduler=Li2018', + #'autoscheduler.parallelism=32', ] elif p['autoschedule'] compile_cmd += [ 'target=host', - '-p', 'autoschedule_mullapudi2016', - 'autoscheduler=Mullapudi2016', - # Maximum level of CPU core, or GPU threads available - 'autoscheduler.parallelism=4', - # Size of last level (L2) cache - 'autoscheduler.last_level_cache_size=6291000', - # Ratio of the cache read cost to compute cost - 'autoscheduler.balance=40', + #'-p', '@0@/libautoschedule_mullapudi2016.@1@'.format(halide_library_path, dynamiclib_file_ext), + #'autoscheduler=Mullapudi2016', + ## Maximum level of CPU core, or GPU threads available + #'autoscheduler.parallelism=4', + ## Size of last level (L2) cache + #'autoscheduler.last_level_cache_size=6291000', + ## Ratio of the cache read cost to compute cost + #'autoscheduler.balance=40', ] else compile_cmd += [ diff --git a/proximal/halide/src/user-problem/meson.build b/proximal/halide/src/user-problem/meson.build index 5b1caa8..dab8716 100644 --- a/proximal/halide/src/user-problem/meson.build +++ b/proximal/halide/src/user-problem/meson.build @@ -33,19 +33,18 @@ solver_bin = custom_target( 'ladmm_iter.h', ], input: solver_generator, - env: env, command: [ solver_generator, '-o', meson.current_build_dir(), '-g', 'ladmm_iter', - '-e', 'static_library,h,stmt_html', + '-e', 'static_library,h', 'target=' + halide_target, - '-p', 'autoschedule_mullapudi2016', - 'autoscheduler=Mullapudi2016', - 'autoscheduler.parallelism=4', - 'autoscheduler.last_level_cache_size=6291000', - 'autoscheduler.balance=40', + #'-p', '@0@/libautoschedule_mullapudi2016.@1@'.format(halide_library_path, dynamiclib_file_ext), + #'autoscheduler=Mullapudi2016', + #'autoscheduler.parallelism=4', + #'autoscheduler.last_level_cache_size=6291000', + #'autoscheduler.balance=40', 'n_iter=1', # number of ADMM iterations before checking convergence 'mu=0.333', # Problem scaling factor. Defaults to 1 / sqrt( || K || ). diff --git a/proximal/halide/subprojects/packagefiles/halide/meson.build b/proximal/halide/subprojects/packagefiles/halide/meson.build index cde8570..0a5ad9a 100644 --- a/proximal/halide/subprojects/packagefiles/halide/meson.build +++ b/proximal/halide/subprojects/packagefiles/halide/meson.build @@ -7,9 +7,12 @@ halide_inc = include_directories('include') if build_machine.system() == 'windows' halide_library_path = meson.current_source_dir() / 'lib/Release' + # Halide.dll is in a different path, why? + halide_dll_path = meson.current_source_dir() / 'bin/Release' else halide_library_path = meson.current_source_dir() / 'lib' endif + halide_lib = cc.find_library('Halide', dirs: halide_library_path) halide_generator_dep = declare_dependency(