-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update atomic example to be more stable
- Loading branch information
Showing
5 changed files
with
10 additions
and
62 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# SPDX-FileCopyrightText: 2020 - 2023 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from .atomics import atomic_support_present |
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 |
---|---|---|
@@ -1,32 +1,3 @@ | ||
# SPDX-FileCopyrightText: 2020 - 2023 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import os | ||
import os.path | ||
|
||
|
||
def atomic_support_present(): | ||
if os.path.isfile( | ||
os.path.join(os.path.dirname(__file__), "atomic_ops.spir") | ||
): | ||
return True | ||
else: | ||
return False | ||
|
||
|
||
def get_atomic_spirv_path(): | ||
if atomic_support_present(): | ||
return os.path.join(os.path.dirname(__file__), "atomic_ops.spir") | ||
else: | ||
return None | ||
|
||
|
||
def read_atomic_spirv_file(): | ||
path = get_atomic_spirv_path() | ||
if path: | ||
with open(path, "rb") as fin: | ||
spirv = fin.read() | ||
return spirv | ||
else: | ||
return None |
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