-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add attribute settings to random access
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
RandomAccess/settings/settings.gen.intel.random_access_kernels_single.s10mxhbm.py
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,19 @@ | ||
|
||
global_memory_name = "HBM" | ||
|
||
def generate_attributes(num_replications, num_global_memory_banks=32): | ||
""" | ||
Generates the kernel attributes for the global memory. They specify in which | ||
global memory the buffer is located. The buffers will be placed using a | ||
round robin scheme using the available global memory banks and the number of | ||
replications that should be generated (e.g. if a global memory contains multiple banks) | ||
@param num_replications Number okernel replications | ||
@param num_global_memory_banks Number of global memory banks that should be used for generation | ||
@return Array of strings that contain the attributes for every kernel | ||
""" | ||
global_memory_names = [ "%s%d" % (global_memory_name, i) for i in range(num_global_memory_banks)] | ||
return [ "__attribute__((buffer_location(\"%s\")))" | ||
% (global_memory_names[i % num_global_memory_banks]) | ||
for i in range(num_replications)] |
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