-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: mtsokol <[email protected]> Co-authored-by: rgommers <[email protected]>
- Loading branch information
Showing
39 changed files
with
7,469 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[wrap-file] | ||
directory = OpenBLAS-0.3.28 | ||
source_url = https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.28/OpenBLAS-0.3.28.tar.gz | ||
source_filename = OpenBLAS-0.3.28.tar.gz | ||
source_hash = f1003466ad074e9b0c8d421a204121100b0751c96fc6fcf3d1456bd12f8a00a1 | ||
patch_directory = openblas | ||
|
||
[provide] | ||
openblas = openblas_dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
testl1_src = ['c_?blat1.f', 'c_?blas1.c'] | ||
testl2_src = ['c_?blat2.f', 'c_?blas2.c', 'c_?2chke.c', 'auxiliary.c', 'constant.c', 'c_xerbla.c'] | ||
testl3_src = ['c_?blat3.f', 'c_?blas3.c', 'c_?3chke.c', 'auxiliary.c', 'constant.c', 'c_xerbla.c'] | ||
testl3_3m_src = ['c_?blat3_3m.f', 'c_?blas3_3m.c', 'c_?3chke_3m.c', 'auxiliary.c', 'constant.c', 'c_xerbla.c'] | ||
|
||
_test_input_array = { | ||
'l1': { | ||
'base': 'x?blat1', | ||
'has_dat': false, | ||
'types': ['s', 'd', 'c', 'z'], | ||
'sources': testl1_src, | ||
}, | ||
'l2': { | ||
'base': 'x?cblat2', | ||
'has_dat': true, | ||
'types': ['s', 'd', 'c', 'z'], | ||
'sources': testl2_src, | ||
'input_file': '?in2', | ||
}, | ||
'l3': { | ||
'base': 'x?cblat3', | ||
'has_dat': true, | ||
'types': ['s', 'd', 'c', 'z'], | ||
'sources': testl3_src, | ||
'input_file': '?in3', | ||
}, | ||
} | ||
|
||
lvls = ['l1', 'l3'] | ||
# TODO(rg) : Times out.. | ||
if not is_win | ||
lvls += ['l2'] | ||
endif | ||
|
||
if conf_hdat.has('ARCH_X86_64') or conf_hdat.has('ARCH_X86') | ||
_test_input_array += { | ||
'l3_3m': { | ||
'base': 'x?cblat3_3m', | ||
'has_dat': true, | ||
'types': ['c', 'z'], | ||
'sources': testl3_3m_src, | ||
'input_file': '?in3_3m', | ||
} | ||
} | ||
lvls += 'l3_3m' | ||
endif | ||
|
||
_test_runner = executable('test_runner', sources: ['test_runner.c'], install: false) | ||
ctest_inc = _inc + [include_directories('.')] | ||
|
||
foreach lvl : lvls | ||
details = _test_input_array[lvl] | ||
|
||
foreach type : details['types'] | ||
op_name = details['base'].replace('?', type) | ||
|
||
mapped_sources = [] | ||
foreach source : details['sources'] | ||
mapped_sources += source.replace('?', type) | ||
endforeach | ||
|
||
executable( | ||
op_name, | ||
sources: mapped_sources, | ||
link_with: [openblas_static], | ||
dependencies: [dependency('threads')], | ||
include_directories: ctest_inc, | ||
c_args: ['-DADD_', '-DCBLAS'], | ||
) | ||
|
||
if is_win | ||
obj_name = op_name | ||
else | ||
obj_name = f'./@op_name@' | ||
endif | ||
|
||
_args = [obj_name] | ||
if details.has_key('input_file') | ||
_args += [meson.current_source_dir() / details['input_file'].replace('?', type)] | ||
endif | ||
|
||
test( | ||
op_name, | ||
_test_runner, | ||
args: _args, | ||
workdir: meson.current_build_dir(), | ||
) # TODO: add OPENBLAS_NUM_THREADS=2 | ||
|
||
endforeach | ||
endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main(int argc, char *argv[]) { | ||
if (argc != 2 && argc != 3) { | ||
fprintf(stderr, "Usage: %s <executable> <optional_input_file>\n", argv[0]); | ||
return EXIT_FAILURE; | ||
} | ||
|
||
char command[1024]; | ||
if (argc == 2) { | ||
snprintf(command, sizeof(command), "%s", argv[1]); | ||
} else { | ||
snprintf(command, sizeof(command), "%s < %s", argv[1], argv[2]); | ||
} | ||
|
||
int result = system(command); | ||
if (result != EXIT_SUCCESS) { | ||
fprintf(stderr, "Error: Command '%s' failed with return code %d.\n", command, result); | ||
return EXIT_FAILURE; | ||
} | ||
|
||
return EXIT_SUCCESS; | ||
} |
Oops, something went wrong.