This repository has been archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge amd-stg-open into amd-mainline-open
Merge for Jan15th Change-Id: I3f9619d64aabe8b61cddceda124ecd747c51db1a
- Loading branch information
Showing
9 changed files
with
274 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
##===-------------------------------------------------------------------------- | ||
## ROCm Device Libraries | ||
## | ||
## This file is distributed under the University of Illinois Open Source | ||
## License. See LICENSE.TXT for details. | ||
##===-------------------------------------------------------------------------- | ||
|
||
file(GLOB sources | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cl | ||
) | ||
|
||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../irif/inc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../oclc/inc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
|
||
opencl_bc_lib(NAME asanrtl SOURCES ${sources}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/*===-------------------------------------------------------------------------- | ||
* ROCm Device Libraries | ||
* | ||
* This file is distributed under the University of Illinois Open Source | ||
* License. See LICENSE.TXT for details. | ||
*===------------------------------------------------------------------------*/ | ||
|
||
typedef ulong uptr; | ||
|
||
void __asan_report_load_n(uptr addr, uptr size) {} | ||
|
||
void __asan_loadN(uptr addr, uptr size) {} | ||
|
||
void __asan_report_load1(uptr addr) {} | ||
|
||
void __asan_load1(uptr addr) {} | ||
|
||
void __asan_report_load2(uptr addr) {} | ||
|
||
void __asan_load2(uptr addr) {} | ||
|
||
void __asan_report_load4(uptr addr) {} | ||
|
||
void __asan_load4(uptr addr) {} | ||
|
||
void __asan_report_load8(uptr addr) {} | ||
|
||
void __asan_load8(uptr addr) {} | ||
|
||
void __asan_report_load16(uptr addr) {} | ||
|
||
void __asan_load16(uptr addr) {} | ||
|
||
void __asan_report_store_n(uptr addr, uptr size) {} | ||
|
||
void __asan_storeN(uptr addr, uptr size) {} | ||
|
||
void __asan_report_store1(uptr addr) {} | ||
|
||
void __asan_store1(uptr addr) {} | ||
|
||
void __asan_report_store2(uptr addr) {} | ||
|
||
void __asan_store2(uptr addr) {} | ||
|
||
void __asan_report_store4(uptr addr) {} | ||
|
||
void __asan_store4(uptr addr) {} | ||
|
||
void __asan_report_store8(uptr addr) {} | ||
|
||
void __asan_store8(uptr addr) {} | ||
|
||
void __asan_report_store16(uptr addr) {} | ||
|
||
void __asan_store16(uptr addr) {} | ||
|
||
void* __asan_memmove(void* to, void* from, uptr size) { return to; } | ||
|
||
void* __asan_memcpy(void* to, void* from, uptr size) { return to; } | ||
|
||
void* __asan_memset(void* s, int c, uptr n) { return s; } | ||
|
||
void __asan_handle_no_return(void) {} | ||
|
||
void __sanitizer_ptr_cmp(uptr a, uptr b) {} | ||
|
||
void __sanitizer_ptr_sub(uptr a, uptr b) {} | ||
|
||
void __asan_before_dynamic_init(uptr addr) {} | ||
|
||
void __asan_after_dynamic_init(void) {} | ||
|
||
void __asan_register_globals(void *start, uptr n) {} | ||
|
||
void __asan_unregister_globals(void *start, uptr n) {} | ||
|
||
void __asan_register_image_globals(uptr flag) {} | ||
|
||
void __asan_unregister_image_globals(uptr flag) {} | ||
|
||
void __asan_register_elf_globals(uptr flag, uptr start, uptr stop) {} | ||
|
||
void __asan_unregister_elf_globals(uptr flag, uptr start, uptr stop) {} | ||
|
||
void __asan_init(void) {} | ||
|
||
void __asan_version_mismatch_check_v8(void) {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
/*===-------------------------------------------------------------------------- | ||
* ROCm Device Libraries | ||
* | ||
* This file is distributed under the University of Illinois Open Source | ||
* License. See LICENSE.TXT for details. | ||
*===------------------------------------------------------------------------*/ | ||
|
||
#include "irif.h" | ||
#include "ockl.h" | ||
#include "oclc.h" | ||
|
||
__attribute__((target("s-memrealtime"))) void | ||
OCKL_MANGLE_T(rtcwait,u32)(uint ticks) | ||
{ | ||
ulong now = __builtin_amdgcn_s_memrealtime(); | ||
ulong end = now + __builtin_amdgcn_readfirstlane(ticks); | ||
|
||
if (__oclc_ISA_version >= 9000) { | ||
while (end > now + 1625) { | ||
__builtin_amdgcn_s_sleep(127); | ||
now = __builtin_amdgcn_s_memrealtime(); | ||
} | ||
|
||
while (end > now + 806) { | ||
__builtin_amdgcn_s_sleep(63); | ||
now = __builtin_amdgcn_s_memrealtime(); | ||
} | ||
|
||
while (end > now + 396) { | ||
__builtin_amdgcn_s_sleep(31); | ||
now = __builtin_amdgcn_s_memrealtime(); | ||
} | ||
} | ||
|
||
while (end > now + 192) { | ||
__builtin_amdgcn_s_sleep(15); | ||
now = __builtin_amdgcn_s_memrealtime(); | ||
} | ||
|
||
while (end > now + 89) { | ||
__builtin_amdgcn_s_sleep(7); | ||
now = __builtin_amdgcn_s_memrealtime(); | ||
} | ||
|
||
while (end > now + 38) { | ||
__builtin_amdgcn_s_sleep(3); | ||
now = __builtin_amdgcn_s_memrealtime(); | ||
} | ||
|
||
while (end > now) { | ||
__builtin_amdgcn_s_sleep(1); | ||
now = __builtin_amdgcn_s_memrealtime(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.