Skip to content

Commit

Permalink
[OpenMP][FIX] Fix memset oversight to partially unblock test
Browse files Browse the repository at this point in the history
The tests "unoptimized" version is still broken, disabled for now.
  • Loading branch information
jdoerfert committed Oct 22, 2023
1 parent 904c5b4 commit 9f3b06d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openmp/libomptarget/DeviceRTL/src/State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void state::enterDataEnvironment(IdentTy *Ident) {
uint32_t Bytes = sizeof(ThreadStates[0]) * mapping::getMaxTeamThreads();
void *ThreadStatesPtr =
memory::allocGlobal(Bytes, "Thread state array allocation");
memset(ThreadStatesPtr, '0', Bytes);
memset(ThreadStatesPtr, 0, Bytes);
if (!atomic::cas(ThreadStatesBitsPtr, uintptr_t(0),
reinterpret_cast<uintptr_t>(ThreadStatesPtr),
atomic::seq_cst, atomic::seq_cst))
Expand Down
5 changes: 2 additions & 3 deletions openmp/libomptarget/test/offloading/thread_state_1.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// RUN: %libomptarget-compile-run-and-check-generic
// Still broken "without optimizations"
// XUN: %libomptarget-compile-run-and-check-generic
// RUN: %libomptarget-compileopt-run-and-check-generic

// UNSUPPORTED: amdgcn-amd-amdhsa

#include <omp.h>
#include <stdio.h>

Expand Down

0 comments on commit 9f3b06d

Please sign in to comment.