CommonTestSetup.js (936B)
1 // |jit-test| skip-if:true; 2 3 // This file contains all the code that is common to all integer gemm intrinsics' test scripts. 4 5 // The test setup as string that is common to all integer gemm tests 6 export const COMMON_TEST_SETUP_AS_STRING = ` 7 const libdir=${JSON.stringify(libdir)}; load(libdir + "wasm.js"); 8 let memory = new WebAssembly.Memory({initial: 1, maximum: 1}); 9 let module = WebAssembly.mozIntGemm(); 10 if (!module) { 11 throw new Error(); 12 } 13 let instance = new WebAssembly.Instance(module, {"": {"memory": memory}}); 14 15 const ARRAY_ALIGNMENT = 64; 16 const ROWS_A_MULTIPLIER = 1; 17 const COLUMNS_A_MULTIPLIER = 64; 18 const ROWS_B_MULTIPLIER = COLUMNS_A_MULTIPLIER; 19 const COLUMNS_B_MULTIPLIER = 8; 20 const SELECTED_COLUMNS_B_MULTIPLIER = 8; 21 ` 22 23 // Run the test 24 export function runTest(completeTestAsString) { 25 const testEnvironment = newGlobal({newCompartment: true, systemPrincipal: true}); 26 testEnvironment.evaluate(completeTestAsString); 27 }