mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
fix benchmarks not compiling and make sure it doesn't happen again by checking
This commit is contained in:
@@ -36,6 +36,8 @@ jobs:
|
|||||||
./odin test tests/core/speed.odin -file -all-packages -vet -strict-style -disallow-do -o:speed -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
./odin test tests/core/speed.odin -file -all-packages -vet -strict-style -disallow-do -o:speed -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
||||||
./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
||||||
(cd tests/issues; ./run.sh)
|
(cd tests/issues; ./run.sh)
|
||||||
|
./odin check tests/benchmarks -vet -strict-style -no-entry-point
|
||||||
|
|
||||||
build_freebsd:
|
build_freebsd:
|
||||||
name: FreeBSD Build, Check, and Test
|
name: FreeBSD Build, Check, and Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -64,6 +66,7 @@ jobs:
|
|||||||
./odin test tests/core/speed.odin -file -all-packages -vet -strict-style -disallow-do -o:speed -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
./odin test tests/core/speed.odin -file -all-packages -vet -strict-style -disallow-do -o:speed -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
||||||
./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
||||||
(cd tests/issues; ./run.sh)
|
(cd tests/issues; ./run.sh)
|
||||||
|
./odin check tests/benchmarks -vet -strict-style -no-entry-point
|
||||||
ci:
|
ci:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -128,6 +131,8 @@ jobs:
|
|||||||
cd tests/issues
|
cd tests/issues
|
||||||
./run.sh
|
./run.sh
|
||||||
|
|
||||||
|
- name: Check benchmarks
|
||||||
|
run: ./odin check tests/benchmarks -vet -strict-style -no-entry-point
|
||||||
- name: Odin check examples/all for Linux i386
|
- name: Odin check examples/all for Linux i386
|
||||||
run: ./odin check examples/all -vet -strict-style -disallow-do -target:linux_i386
|
run: ./odin check examples/all -vet -strict-style -disallow-do -target:linux_i386
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
@@ -203,6 +208,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
||||||
odin test tests/internal -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
odin test tests/internal -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
|
||||||
|
- name: Check benchmarks
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
||||||
|
odin check tests/benchmarks -vet -strict-style -no-entry-point
|
||||||
- name: Odin documentation tests
|
- name: Odin documentation tests
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ sizes := [?]int {
|
|||||||
|
|
||||||
// These are the normal, unoptimized algorithms.
|
// These are the normal, unoptimized algorithms.
|
||||||
|
|
||||||
plain_index_byte :: proc(s: []u8, c: byte) -> (res: int) #no_bounds_check {
|
plain_index_byte :: proc "contextless" (s: []u8, c: byte) -> (res: int) #no_bounds_check {
|
||||||
for i := 0; i < len(s); i += 1 {
|
for i := 0; i < len(s); i += 1 {
|
||||||
if s[i] == c {
|
if s[i] == c {
|
||||||
return i
|
return i
|
||||||
@@ -34,7 +34,7 @@ plain_index_byte :: proc(s: []u8, c: byte) -> (res: int) #no_bounds_check {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
plain_last_index_byte :: proc(s: []u8, c: byte) -> (res: int) #no_bounds_check {
|
plain_last_index_byte :: proc "contextless" (s: []u8, c: byte) -> (res: int) #no_bounds_check {
|
||||||
for i := len(s)-1; i >= 0; i -= 1 {
|
for i := len(s)-1; i >= 0; i -= 1 {
|
||||||
if s[i] == c {
|
if s[i] == c {
|
||||||
return i
|
return i
|
||||||
@@ -43,7 +43,7 @@ plain_last_index_byte :: proc(s: []u8, c: byte) -> (res: int) #no_bounds_check {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
run_trial_size :: proc(p: proc([]u8, byte) -> int, size: int, idx: int, runs: int) -> (timing: time.Duration) {
|
run_trial_size :: proc(p: proc "contextless" ([]u8, byte) -> int, size: int, idx: int, runs: int) -> (timing: time.Duration) {
|
||||||
data := make([]u8, size)
|
data := make([]u8, size)
|
||||||
defer delete(data)
|
defer delete(data)
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ run_trial_size :: proc(p: proc([]u8, byte) -> int, size: int, idx: int, runs: in
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
bench_table :: proc(algo_name: string, forward: bool, plain: proc([]u8, byte) -> int, simd: proc([]u8, byte) -> int) {
|
bench_table :: proc(algo_name: string, forward: bool, plain: proc "contextless" ([]u8, byte) -> int, simd: proc "contextless" ([]u8, byte) -> int) {
|
||||||
string_buffer := strings.builder_make()
|
string_buffer := strings.builder_make()
|
||||||
defer strings.builder_destroy(&string_buffer)
|
defer strings.builder_destroy(&string_buffer)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user