mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-03 08:02:41 +00:00
[libc][Obvious] Fix timing on AMDGPU not being initialized
Summary: Reviewer requested that this routine not be a macro, however that means that it was not being intitialized as the static initializer was done before the memcpy from the device. Fix this so we can get timing information.
This commit is contained in:
parent
a2b7297dff
commit
515bd1c9b8
@ -19,11 +19,12 @@
|
||||
#include "src/__support/GPU/utils.h"
|
||||
static long clock() { return __llvm_libc::gpu::fixed_frequency_clock(); }
|
||||
#if defined(LIBC_TARGET_ARCH_IS_NVPTX)
|
||||
uint64_t CLOCKS_PER_SEC = 1000000000UL;
|
||||
#define CLOCKS_PER_SEC 1000000000UL
|
||||
#else
|
||||
// The AMDGPU loader needs to initialize this at runtime by querying the driver.
|
||||
extern "C" [[gnu::visibility("protected")]] uint64_t __llvm_libc_clock_freq;
|
||||
uint64_t CLOCKS_PER_SEC = __llvm_libc_clock_freq;
|
||||
extern "C" [[gnu::visibility("protected")]] uint64_t
|
||||
[[clang::address_space(4)]] __llvm_libc_clock_freq;
|
||||
#define CLOCKS_PER_SEC __llvm_libc_clock_freq
|
||||
#endif
|
||||
#else
|
||||
static long clock() { return 0; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user