Skip to content

Commit d24b3cf

Browse files
authored
properly fix buffer allocation and assignment
1 parent eba8615 commit d24b3cf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

driver/others/blas_server.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,11 @@ fprintf(STDERR, "Server[%2ld] Calculation started. Mode = 0x%03x M = %3ld N=%3l
10761076
main_status[cpu] = MAIN_RUNNING1;
10771077
#endif
10781078

1079-
if (buffer == NULL) blas_thread_buffer[cpu] = blas_memory_alloc(2);
1079+
if (buffer == NULL) {
1080+
blas_thread_buffer[cpu] = blas_memory_alloc(2);
1081+
buffer = blas_thread_buffer[cpu];
1082+
}
1083+
10801084

10811085
//For target LOONGSON3R5, applying an offset to the buffer is essential
10821086
//for minimizing cache conflicts and optimizing performance.

0 commit comments

Comments
 (0)