Merge pull request #4879 from martin-frbg/issue4868-2

Ensure a memory buffer has been allocated for each thread before invoking it (take 2)
This commit is contained in:
Martin Kroeker 2024-08-15 22:06:54 +02:00 committed by GitHub
commit 3ee9e9d8d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -1076,7 +1076,11 @@ fprintf(STDERR, "Server[%2ld] Calculation started. Mode = 0x%03x M = %3ld N=%3l
main_status[cpu] = MAIN_RUNNING1;
#endif
if (buffer == NULL) blas_thread_buffer[cpu] = blas_memory_alloc(2);
if (buffer == NULL) {
blas_thread_buffer[cpu] = blas_memory_alloc(2);
buffer = blas_thread_buffer[cpu];
}
//For target LOONGSON3R5, applying an offset to the buffer is essential
//for minimizing cache conflicts and optimizing performance.