// // Copyright (C) 2009-2021 Intel Corporation // // SPDX-License-Identifier: MIT // // module bvh_on_gpu_checks; kernel_module debug_kernels ("bvh_debug.cl") { links lsc_intrinsics; kernel opencl_check_tree_topology < kernelFunction="check_tree_topology">; kernel opencl_check_instances_linked_bvhs < kernelFunction="check_instances_linked_bvhs">; kernel opencl_check_geos_before_quad_update < kernelFunction="check_geos_before_quad_update">; kernel opencl_check_geos_vs_quads < kernelFunction="check_geos_vs_quads">; } metakernel debug_checks_prepare_const_regs() { define cRoundingSIMD REG4; define cInit0 REG5; define cShiftForSIMD REG3; cRoundingSIMD = (16-1); cShiftForSIMD = 4; DISPATCHDIM_Y = 1; DISPATCHDIM_Z = 1; } metakernel debug_checks_bvh_topology( qword some_null_ptr, qword bvh, qword bvh_inner_nodes_end, qword error_struct, dword when, dword bvh_inner_nodes_start_value ) { define cRoundingSIMD REG4; define cShiftForSIMD REG3; REG1.lo = load_dword(bvh_inner_nodes_end); REG0 = bvh_inner_nodes_start_value; REG1.hi = 0; REG2 = REG1 - REG0; REG2 = REG2 + cRoundingSIMD; REG2 = REG2 >> cShiftForSIMD; DISPATCHDIM_X = REG2.lo; dispatch_indirect opencl_check_tree_topology args( some_null_ptr, bvh, error_struct, when); } metakernel debug_check_instances_linked_bvhs( qword some_null_ptr, qword bvh, qword error_struct, dword numHWThreads, dword when) { dispatch opencl_check_instances_linked_bvhs(numHWThreads,1,1) args( some_null_ptr, bvh, error_struct, when); } metakernel debug_check_geos_before_quad_update( qword bvh, qword geos, qword some_null_ptr, qword error_struct, dword when, dword numGeos, dword numHWThreads ) { dispatch opencl_check_geos_before_quad_update(numHWThreads,1,1) args( bvh, geos, some_null_ptr, error_struct, when, numGeos, numHWThreads ); } metakernel debug_check_geos_vs_quads( qword bvh, qword geos, qword some_null_ptr, qword error_struct, dword when, dword numGeos, dword numHWThreads ) { dispatch opencl_check_geos_vs_quads(numHWThreads,1,1) args( bvh, geos, some_null_ptr, error_struct, when, numGeos, numHWThreads ); }