Skip to content

Commit 3ee9e9d

Browse files
authored
Merge pull request #4879 from martin-frbg/issue4868-2
Ensure a memory buffer has been allocated for each thread before invoking it (take 2)
2 parents dd71df8 + d24b3cf commit 3ee9e9d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

driver/others/blas_server.c

+5-1
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)