-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
877 additions
and
10 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
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 |
---|---|---|
@@ -1,8 +1,32 @@ | ||
#include "acc1.h" | ||
|
||
|
||
__attribute__((weak)) void NN__acc1_f32(size_t n, float *result, size_t incx, float scalar) { | ||
for (size_t i = 0; i < n; i += incx) { | ||
result[i] += scalar; | ||
__attribute__((weak)) void NN__acc1_i8(size_t n, int8_t *result, size_t incr, int8_t scalar) { | ||
for (size_t i = 0; i < n; i += 1) { | ||
result[i + incr] += scalar; | ||
} | ||
} | ||
|
||
__attribute__((weak)) void NN__acc1_i16(size_t n, int16_t *result, size_t incr, int16_t scalar) { | ||
for (size_t i = 0; i < n; i += 1) { | ||
result[i + incr] += scalar; | ||
} | ||
} | ||
|
||
__attribute__((weak)) void NN__acc1_i32(size_t n, int32_t *result, size_t incr, int32_t scalar) { | ||
for (size_t i = 0; i < n; i += 1) { | ||
result[i + incr] += scalar; | ||
} | ||
} | ||
|
||
__attribute__((weak)) void NN__acc1_f16(size_t n, float16_t *result, size_t incr, float16_t scalar) { | ||
for (size_t i = 0; i < n; i += 1) { | ||
result[i + incr] = NN_float_to_half(NN_half_to_float(result[i * incr]) + NN_half_to_float(scalar)); | ||
} | ||
} | ||
|
||
__attribute__((weak)) void NN__acc1_f32(size_t n, float *result, size_t incr, float scalar) { | ||
for (size_t i = 0; i < n; i += 1) { | ||
result[i + incr] += scalar; | ||
} | ||
} |
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
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
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
Oops, something went wrong.