Skip to content

Commit

Permalink
Modify buildbots to enable testing for halide/Halide#7763
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-johnson committed Aug 22, 2023
1 parent 1b24a51 commit 7bb4a7b
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions master/master.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- python -*-
-D# -*- python -*-
# ex: set syntax=python:
# vim: set syntax=python:

Expand Down Expand Up @@ -289,6 +289,18 @@ class BuilderType:

return True

# Only do the special build/test for testing serialization
# via JIT on the x64-linux systems -- we could do them anywhere,
# but on a single fast system is good enough
def handles_serialization_jit_testing(self):
if self.buildsystem != BuildSystem.cmake:
return False

return (self.arch == 'x86'
and self.bits == 64
and self.os == 'linux'
and self.llvm_branch == LLVM_MAIN)

def handles_sanitizers(self):
if self.buildsystem != BuildSystem.cmake:
return False
Expand Down Expand Up @@ -625,7 +637,7 @@ def get_ctest_options(builder_type, build_dir):
return {'build_config': 'Release'}


def get_halide_cmake_definitions(builder_type, halide_target='host', wasm_jit='wabt'):
def get_halide_cmake_definitions(builder_type, halide_target='host', wasm_jit='wabt', extra_cmake_defs={}):
cmake_definitions = {
'Clang_DIR': get_llvm_install_path(builder_type, 'lib/cmake/clang'),
'CMAKE_INSTALL_PREFIX': get_halide_install_path(builder_type),
Expand All @@ -634,7 +646,8 @@ def get_halide_cmake_definitions(builder_type, halide_target='host', wasm_jit='w
'LLVM_DIR': get_llvm_install_path(builder_type, 'lib/cmake/llvm'),
'LLVM_ROOT': get_llvm_install_path(builder_type),
'WITH_PYTHON_BINDINGS': 'ON' if builder_type.handles_python() else 'OFF',
'WITH_TEST_FUZZ': 'ON' if builder_type.sanitizer == 'fuzzer' else 'OFF'
'WITH_TEST_FUZZ': 'ON' if builder_type.sanitizer == 'fuzzer' else 'OFF',
**extra_cmake_defs
}

if builder_type.sanitizer and builder_type.handles_sanitizers():
Expand Down Expand Up @@ -1217,7 +1230,20 @@ def add_halide_cmake_test_steps(factory, builder_type):
keys.sort()
keys.insert(0, 'host')

# A bit of an ugly hack here -- if we are doing serialization testing
# via JIT, do it right after `host` so that very little needs rebuilding.
# To accomplish this we insert a dummy target in the list.
_FAKE_SERIALIZATION_JIT_TEST_TARGET = 'host-serialization_jit_testing'
if builder_type.handles_serialization_jit_testing():
keys.insert(1, _FAKE_SERIALIZATION_JIT_TEST_TARGET)

for halide_target in keys:
if halide_target == _FAKE_SERIALIZATION_JIT_TEST_TARGET:
halide_target = 'host'
extra_cmake_defs = {'WITH_SERIALIZATION_JIT' : 'ON'}
else:
extra_cmake_defs = {}

# HL_TARGET is now ignored by CMake builds, no need to set
# (must specify -DHalide_TARGET to CMake instead)
# env['HL_TARGET'] = halide_target
Expand All @@ -1241,21 +1267,26 @@ def add_halide_cmake_test_steps(factory, builder_type):
if not wasm_jit:
wasm_jit = 'wabt'

cmake_defs = get_halide_cmake_definitions(
builder_type,
halide_target=halide_target,
wasm_jit=wasm_jit,
extra_cmake_defs=extra_cmake_defs)

factory.addStep(
CMake(name='Reconfigure for %s' % short_target(halide_target),
CMake(name='Reconfigure for %s' % desc,
description='Reconfigure for %s' % desc,
locks=[performance_lock.access('counting')],
haltOnFailure=True,
env=env,
workdir=build_dir,
path=source_dir,
generator=get_cmake_generator(builder_type),
definitions=get_halide_cmake_definitions(
builder_type, halide_target=halide_target, wasm_jit=wasm_jit),
definitions=cmake_defs,
options=get_halide_cmake_options(builder_type, build_dir)))

factory.addStep(
ShellCommand(name='Rebuild for %s' % (short_target(halide_target)),
ShellCommand(name='Rebuild for %s' % desc,
description='Rebuild Halide for %s' % desc,
locks=[performance_lock.access('counting')],
haltOnFailure=True,
Expand Down

0 comments on commit 7bb4a7b

Please sign in to comment.