gem5 v24.0.0.0
Loading...
Searching...
No Matches
hsa.h
Go to the documentation of this file.
1
2//
3// The University of Illinois/NCSA
4// Open Source License (NCSA)
5//
6// Copyright (c) 2014-2015, Advanced Micro Devices, Inc. All rights reserved.
7//
8// Developed by:
9//
10// AMD Research and AMD HSA Software Development
11//
12// Advanced Micro Devices, Inc.
13//
14// www.amd.com
15//
16// Permission is hereby granted, free of charge, to any person obtaining a copy
17// of this software and associated documentation files (the "Software"), to
18// deal with the Software without restriction, including without limitation
19// the rights to use, copy, modify, merge, publish, distribute, sublicense,
20// and/or sell copies of the Software, and to permit persons to whom the
21// Software is furnished to do so, subject to the following conditions:
22//
23// - Redistributions of source code must retain the above copyright notice,
24// this list of conditions and the following disclaimers.
25// - Redistributions in binary form must reproduce the above copyright
26// notice, this list of conditions and the following disclaimers in
27// the documentation and/or other materials provided with the distribution.
28// - Neither the names of Advanced Micro Devices, Inc,
29// nor the names of its contributors may be used to endorse or promote
30// products derived from this Software without specific prior written
31// permission.
32//
33// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
36// THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
37// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
38// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
39// DEALINGS WITH THE SOFTWARE.
40//
42
43#ifndef HSA_RUNTIME_INC_HSA_H_
44#define HSA_RUNTIME_INC_HSA_H_
45
46#include <stddef.h> /* size_t */
47#include <stdint.h> /* uintXX_t */
48
49#ifndef __cplusplus
50#include <stdbool.h> /* bool */
51#endif /* __cplusplus */
52
53// Placeholder for calling convention and import/export macros
54#ifndef HSA_CALL
55#define HSA_CALL
56#endif
57
58#ifndef HSA_EXPORT_DECORATOR
59#ifdef __GNUC__
60#define HSA_EXPORT_DECORATOR __attribute__ ((visibility ("default")))
61#else
62#define HSA_EXPORT_DECORATOR
63#endif
64#endif
65#define HSA_API_EXPORT HSA_EXPORT_DECORATOR HSA_CALL
66#define HSA_API_IMPORT HSA_CALL
67
68#if !defined(HSA_API) && defined(HSA_EXPORT)
69#define HSA_API HSA_API_EXPORT
70#else
71#define HSA_API HSA_API_IMPORT
72#endif
73
74// Detect and set large model builds.
75#undef HSA_LARGE_MODEL
76#if defined(__LP64__) || defined(_M_X64)
77#define HSA_LARGE_MODEL
78#endif
79
80// Try to detect CPU endianness
81#if !defined(LITTLEENDIAN_CPU) && !defined(BIGENDIAN_CPU)
82#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \
83 defined(_M_X64) || defined(__aarch64__)
84#define LITTLEENDIAN_CPU
85#endif
86#endif
87
88#undef HSA_LITTLE_ENDIAN
89#if defined(LITTLEENDIAN_CPU)
90#define HSA_LITTLE_ENDIAN
91#elif defined(BIGENDIAN_CPU)
92#else
93#error "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined"
94#endif
95
96#ifndef HSA_DEPRECATED
97#define HSA_DEPRECATED
98//#ifdef __GNUC__
99//#define HSA_DEPRECATED __attribute__((deprecated))
100//#else
101//#define HSA_DEPRECATED __declspec(deprecated)
102//#endif
103#endif
104
105#define HSA_VERSION_1_0 1
106
107#ifdef __cplusplus
108namespace gem5
109{
110
111extern "C" {
112#endif /* __cplusplus */
113
121typedef enum
122{
264
266
285 const char ** status_string);
286
296typedef struct hsa_dim3_s
297{
301 uint32_t x;
302
306 uint32_t y;
307
311 uint32_t z;
313
332
336typedef int hsa_file_t;
337
363
385
407
423
441
488
507 hsa_system_info_t attribute,
508 void* value);
509
554
574 uint16_t extension,
575 const char **name);
576
602 uint16_t extension,
603 uint16_t version_major,
604 uint16_t version_minor,
605 bool* result);
606
631 uint16_t extension,
632 uint16_t version_major,
633 uint16_t *version_minor,
634 bool* result);
635
636
671 uint16_t extension,
672 uint16_t version_major,
673 uint16_t version_minor,
674 void *table);
675
711 uint16_t extension,
712 uint16_t version_major,
713 size_t table_length,
714 void *table);
715
722typedef struct hsa_agent_s
723{
728 uint64_t handle;
730
746
765
787
1009
1032 hsa_agent_t agent,
1033 hsa_agent_info_t attribute,
1034 void* value);
1035
1057 hsa_status_t (*callback)(hsa_agent_t agent, void* data),
1058 void* data);
1059
1060/*
1061
1062// If we do not know the size of an attribute, we need to query it first
1063// Note: this API will not be in the spec unless needed
1064hsa_status_t HSA_API hsa_agent_get_info_size(
1065 hsa_agent_t agent,
1066 hsa_agent_info_t attribute,
1067 size_t* size);
1068
1069// Set the value of an agents attribute
1070// Note: this API will not be in the spec unless needed
1071hsa_status_t HSA_API hsa_agent_set_info(
1072 hsa_agent_t agent,
1073 hsa_agent_info_t attribute,
1074 void* value);
1075
1076*/
1077
1092
1121 hsa_agent_t agent,
1122 hsa_profile_t profile,
1123 uint16_t *mask);
1124
1128typedef struct hsa_cache_s
1129{
1134 uint64_t handle;
1136
1164
1188 hsa_cache_t cache,
1189 hsa_cache_info_t attribute,
1190 void* value);
1191
1220 hsa_agent_t agent,
1221 hsa_status_t (*callback)(hsa_cache_t cache, void* data),
1222 void* data);
1223
1254 uint16_t extension,
1255 hsa_agent_t agent,
1256 uint16_t version_major,
1257 uint16_t version_minor,
1258 bool* result);
1259
1289 uint16_t extension,
1290 hsa_agent_t agent,
1291 uint16_t version_major,
1292 uint16_t *version_minor,
1293 bool* result);
1294
1295
1306typedef struct hsa_signal_s
1307{
1312 uint64_t handle;
1314
1319#ifdef HSA_LARGE_MODEL
1320 typedef int64_t hsa_signal_value_t;
1321#else
1322 typedef int32_t hsa_signal_value_t;
1323#endif
1324
1356 hsa_signal_value_t initial_value,
1357 uint32_t num_consumers,
1358 const hsa_agent_t *consumers,
1359 hsa_signal_t *signal);
1360
1376 hsa_signal_t signal);
1377
1386 hsa_signal_t signal);
1387
1392 hsa_signal_t signal);
1393
1400 hsa_signal_t signal);
1401
1413 hsa_signal_t signal,
1414 hsa_signal_value_t value);
1415
1420 hsa_signal_t signal,
1421 hsa_signal_value_t value);
1422
1429 hsa_signal_t signal,
1430 hsa_signal_value_t value);
1431
1446 hsa_signal_t signal,
1447 hsa_signal_value_t value);
1448
1453 hsa_signal_t signal,
1454 hsa_signal_value_t value);
1455
1471 hsa_signal_t signal,
1472 hsa_signal_value_t value);
1473
1480 hsa_signal_t signal,
1481 hsa_signal_value_t value);
1482
1487 hsa_signal_t signal,
1488 hsa_signal_value_t value);
1489
1496 hsa_signal_t signal,
1497 hsa_signal_value_t value);
1498
1503 hsa_signal_t signal,
1504 hsa_signal_value_t value);
1509 hsa_signal_t signal,
1510 hsa_signal_value_t value);
1511
1518 hsa_signal_t signal,
1519 hsa_signal_value_t value);
1520
1540 hsa_signal_t signal,
1542 hsa_signal_value_t value);
1543
1544
1551 hsa_signal_t signal,
1553 hsa_signal_value_t value);
1554
1559 hsa_signal_t signal,
1561 hsa_signal_value_t value);
1562
1569 hsa_signal_t signal,
1571 hsa_signal_value_t value);
1572
1577 hsa_signal_t signal,
1579 hsa_signal_value_t value);
1580
1585 hsa_signal_t signal,
1587 hsa_signal_value_t value);
1588
1595 hsa_signal_t signal,
1597 hsa_signal_value_t value);
1598
1612 hsa_signal_t signal,
1613 hsa_signal_value_t value);
1614
1621 hsa_signal_t signal,
1622 hsa_signal_value_t value);
1623
1628 hsa_signal_t signal,
1629 hsa_signal_value_t value);
1630
1637 hsa_signal_t signal,
1638 hsa_signal_value_t value);
1639
1644 hsa_signal_t signal,
1645 hsa_signal_value_t value);
1646
1651 hsa_signal_t signal,
1652 hsa_signal_value_t value);
1653
1654
1661 hsa_signal_t signal,
1662 hsa_signal_value_t value);
1663
1677 hsa_signal_t signal,
1678 hsa_signal_value_t value);
1679
1680
1687 hsa_signal_t signal,
1688 hsa_signal_value_t value);
1689
1694 hsa_signal_t signal,
1695 hsa_signal_value_t value);
1696
1703 hsa_signal_t signal,
1704 hsa_signal_value_t value);
1705
1710 hsa_signal_t signal,
1711 hsa_signal_value_t value);
1712
1717 hsa_signal_t signal,
1718 hsa_signal_value_t value);
1719
1720
1727 hsa_signal_t signal,
1728 hsa_signal_value_t value);
1729
1744 hsa_signal_t signal,
1745 hsa_signal_value_t value);
1746
1753 hsa_signal_t signal,
1754 hsa_signal_value_t value);
1755
1760 hsa_signal_t signal,
1761 hsa_signal_value_t value);
1762
1769 hsa_signal_t signal,
1770 hsa_signal_value_t value);
1771
1776 hsa_signal_t signal,
1777 hsa_signal_value_t value);
1778
1783 hsa_signal_t signal,
1784 hsa_signal_value_t value);
1785
1786
1793 hsa_signal_t signal,
1794 hsa_signal_value_t value);
1795
1809 hsa_signal_t signal,
1810 hsa_signal_value_t value);
1811
1812
1819 hsa_signal_t signal,
1820 hsa_signal_value_t value);
1821
1826 hsa_signal_t signal,
1827 hsa_signal_value_t value);
1828
1835 hsa_signal_t signal,
1836 hsa_signal_value_t value);
1837
1842 hsa_signal_t signal,
1843 hsa_signal_value_t value);
1844
1849 hsa_signal_t signal,
1850 hsa_signal_value_t value);
1851
1858 hsa_signal_t signal,
1859 hsa_signal_value_t value);
1860
1875 hsa_signal_t signal,
1876 hsa_signal_value_t value);
1877
1878
1885 hsa_signal_t signal,
1886 hsa_signal_value_t value);
1887
1892 hsa_signal_t signal,
1893 hsa_signal_value_t value);
1894
1901 hsa_signal_t signal,
1902 hsa_signal_value_t value);
1903
1908 hsa_signal_t signal,
1909 hsa_signal_value_t value);
1910
1915 hsa_signal_t signal,
1916 hsa_signal_value_t value);
1917
1924 hsa_signal_t signal,
1925 hsa_signal_value_t value);
1926
1949
1964
1965
2006 hsa_signal_t signal,
2007 hsa_signal_condition_t condition,
2008 hsa_signal_value_t compare_value,
2009 uint64_t timeout_hint,
2010 hsa_wait_state_t wait_state_hint);
2011
2016 hsa_signal_t signal,
2017 hsa_signal_condition_t condition,
2018 hsa_signal_value_t compare_value,
2019 uint64_t timeout_hint,
2020 hsa_wait_state_t wait_state_hint);
2021
2028 hsa_signal_t signal,
2029 hsa_signal_condition_t condition,
2030 hsa_signal_value_t compare_value,
2031 uint64_t timeout_hint,
2032 hsa_wait_state_t wait_state_hint);
2033
2045
2079 uint32_t num_signals,
2080 const hsa_signal_t *signals,
2081 uint32_t num_consumers,
2082 const hsa_agent_t *consumers,
2083 hsa_signal_group_t *signal_group);
2084
2098 hsa_signal_group_t signal_group);
2099
2148 hsa_signal_group_t signal_group,
2149 const hsa_signal_condition_t *conditions,
2150 const hsa_signal_value_t *compare_values,
2151 hsa_wait_state_t wait_state_hint,
2152 hsa_signal_t *signal,
2153 hsa_signal_value_t *value);
2154
2159 hsa_signal_group_t signal_group,
2160 const hsa_signal_condition_t *conditions,
2161 const hsa_signal_value_t *compare_values,
2162 hsa_wait_state_t wait_state_hint,
2163 hsa_signal_t *signal,
2164 hsa_signal_value_t *value);
2165
2178typedef struct hsa_region_s
2179{
2184 uint64_t handle;
2186
2212
2216typedef uint32_t hsa_queue_type32_t;
2217
2233
2242typedef struct hsa_queue_s
2243{
2248
2253 uint32_t features;
2254
2255#ifdef HSA_LARGE_MODEL
2256 void* base_address;
2257#elif defined HSA_LITTLE_ENDIAN
2262 void* base_address;
2266 uint32_t reserved0;
2267#else
2268 uint32_t reserved0;
2270#endif
2271
2284
2288 uint32_t size;
2292 uint32_t reserved1;
2296 uint64_t id;
2297
2299
2371 hsa_agent_t agent,
2372 uint32_t size,
2374 void (*callback)(hsa_status_t status, hsa_queue_t *source, void *data),
2375 void *data,
2376 uint32_t private_segment_size,
2377 uint32_t group_segment_size,
2378 hsa_queue_t **queue);
2379
2435 hsa_region_t region,
2436 uint32_t size,
2438 uint32_t features,
2439 hsa_signal_t doorbell_signal,
2440 hsa_queue_t **queue);
2441
2466 hsa_queue_t *queue);
2467
2487 hsa_queue_t *queue);
2488
2495 const hsa_queue_t *queue);
2496
2505 const hsa_queue_t *queue);
2506
2511 const hsa_queue_t *queue);
2512
2519 const hsa_queue_t *queue);
2520
2529 const hsa_queue_t *queue);
2530
2535 const hsa_queue_t *queue);
2536
2550 const hsa_queue_t *queue,
2551 uint64_t value);
2552
2559 const hsa_queue_t *queue,
2560 uint64_t value);
2561
2566 const hsa_queue_t *queue,
2567 uint64_t value);
2568
2575 const hsa_queue_t *queue,
2576 uint64_t expected,
2577 uint64_t value);
2578
2594 const hsa_queue_t *queue,
2595 uint64_t expected,
2596 uint64_t value);
2597
2604 const hsa_queue_t *queue,
2605 uint64_t expected,
2606 uint64_t value);
2607
2612 const hsa_queue_t *queue,
2613 uint64_t expected,
2614 uint64_t value);
2615
2620 const hsa_queue_t *queue,
2621 uint64_t expected,
2622 uint64_t value);
2623
2630 const hsa_queue_t *queue,
2631 uint64_t expected,
2632 uint64_t value);
2633
2638 const hsa_queue_t *queue,
2639 uint64_t expected,
2640 uint64_t value);
2641
2648 const hsa_queue_t *queue,
2649 uint64_t value);
2650
2661 const hsa_queue_t *queue,
2662 uint64_t value);
2663
2670 const hsa_queue_t *queue,
2671 uint64_t value);
2672
2677 const hsa_queue_t *queue,
2678 uint64_t value);
2679
2684 const hsa_queue_t *queue,
2685 uint64_t value);
2686
2693 const hsa_queue_t *queue,
2694 uint64_t value);
2695
2700 const hsa_queue_t *queue,
2701 uint64_t value);
2702
2717 const hsa_queue_t *queue,
2718 uint64_t value);
2719
2726 const hsa_queue_t *queue,
2727 uint64_t value);
2728
2733 const hsa_queue_t *queue,
2734 uint64_t value);
2780
2801
2852
2871
2887
2896
2901{
2906 uint16_t header;
2907
2913 uint16_t setup;
2914
2919
2925
2931
2935 uint16_t reserved0;
2936
2941 uint32_t grid_size_x;
2942
2948 uint32_t grid_size_y;
2949
2955 uint32_t grid_size_z;
2956
2961
2969
2975
2976#ifdef HSA_LARGE_MODEL
2977 void* kernarg_address;
2978#elif defined HSA_LITTLE_ENDIAN
2986 void* kernarg_address;
2990 uint32_t reserved1;
2991#else
2992 uint32_t reserved1;
2994#endif
2995
2999 uint64_t reserved2;
3000
3006
3008
3013{
3018 uint16_t header;
3019
3023 uint16_t type;
3024
3028 uint32_t reserved0;
3029
3030#ifdef HSA_LARGE_MODEL
3031 void* return_address;
3032#elif defined HSA_LITTLE_ENDIAN
3036 void* return_address;
3040 uint32_t reserved1;
3041#else
3042 uint32_t reserved1;
3044#endif
3045
3049 uint64_t arg[4];
3050
3054 uint64_t reserved2;
3055
3061
3063
3068{
3073 uint16_t header;
3074
3078 uint16_t reserved0;
3079
3083 uint32_t reserved1;
3084
3090 hsa_signal_t dep_signal[5];
3091
3095 uint64_t reserved2;
3096
3102
3104
3109{
3114 uint16_t header;
3115
3119 uint16_t reserved0;
3120
3124 uint32_t reserved1;
3125
3131 hsa_signal_t dep_signal[5];
3132
3136 uint64_t reserved2;
3137
3143
3145
3180
3206
3273
3296 hsa_region_t region,
3297 hsa_region_info_t attribute,
3298 void* value);
3299
3325 hsa_agent_t agent,
3326 hsa_status_t (*callback)(hsa_region_t region, void* data),
3327 void* data);
3328
3361 size_t size,
3362 void** ptr);
3363
3377
3405 void *dst,
3406 const void *src,
3407 size_t size);
3408
3452 void *ptr,
3453 hsa_agent_t agent,
3455
3493 void *ptr,
3494 size_t size);
3495
3515 void *ptr,
3516 size_t size);
3517
3528typedef struct hsa_isa_s
3529{
3534 uint64_t handle;
3536
3564 const char *name,
3565 hsa_isa_t *isa);
3566
3594 hsa_agent_t agent,
3595 hsa_status_t (*callback)(hsa_isa_t isa, void *data),
3596 void *data);
3597
3709
3748 hsa_isa_t isa,
3749 hsa_isa_info_t attribute,
3750 uint32_t index,
3751 void *value);
3752
3778 hsa_isa_t isa,
3779 hsa_isa_info_t attribute,
3780 void *value);
3781
3805 hsa_isa_t isa,
3806 hsa_profile_t profile,
3807 uint16_t *mask);
3808
3827
3842
3857
3886 hsa_isa_t isa,
3887 hsa_fp_type_t fp_type,
3888 hsa_flush_mode_t flush_mode,
3889 hsa_round_method_t *round_method);
3890
3894typedef struct hsa_wavefront_s
3895{
3900 uint64_t handle;
3902
3914
3937 hsa_wavefront_t wavefront,
3938 hsa_wavefront_info_t attribute,
3939 void *value);
3940
3967 hsa_isa_t isa,
3968 hsa_status_t (*callback)(hsa_wavefront_t wavefront, void *data),
3969 void *data);
3970
3998 hsa_isa_t code_object_isa,
3999 hsa_isa_t agent_isa,
4000 bool *result);
4001
4023
4050 hsa_file_t file,
4051 hsa_code_object_reader_t *code_object_reader);
4052
4078 const void *code_object,
4079 size_t size,
4080 hsa_code_object_reader_t *code_object_reader);
4081
4100 hsa_code_object_reader_t code_object_reader);
4101
4107typedef struct hsa_executable_s
4108{
4113 uint64_t handle;
4115
4136
4171 hsa_profile_t profile,
4172 hsa_executable_state_t executable_state,
4173 const char *options,
4174 hsa_executable_t *executable);
4175
4207 hsa_profile_t profile,
4208 hsa_default_float_rounding_mode_t default_float_rounding_mode,
4209 const char *options,
4210 hsa_executable_t *executable);
4211
4234 hsa_executable_t executable);
4235
4247
4293 hsa_executable_t executable,
4294 hsa_code_object_reader_t code_object_reader,
4295 const char *options,
4296 hsa_loaded_code_object_t *loaded_code_object);
4297
4359 hsa_executable_t executable,
4360 hsa_agent_t agent,
4361 hsa_code_object_reader_t code_object_reader,
4362 const char *options,
4363 hsa_loaded_code_object_t *loaded_code_object);
4364
4395 hsa_executable_t executable,
4396 const char *options);
4397
4418
4441 hsa_executable_t executable,
4442 hsa_executable_info_t attribute,
4443 void *value);
4444
4484 hsa_executable_t executable,
4485 const char *variable_name,
4486 void *address);
4487
4531 hsa_executable_t executable,
4532 hsa_agent_t agent,
4533 const char *variable_name,
4534 void *address);
4535
4583 hsa_executable_t executable,
4584 hsa_agent_t agent,
4585 const char *variable_name,
4586 void *address);
4587
4611 hsa_executable_t executable,
4612 uint32_t *result);
4613
4642 hsa_executable_t executable,
4643 const char *options,
4644 uint32_t *result);
4645
4661
4698 hsa_executable_t executable,
4699 const char *module_name,
4700 const char *symbol_name,
4701 hsa_agent_t agent,
4702 int32_t call_convention,
4703 hsa_executable_symbol_t *symbol);
4704
4735 hsa_executable_t executable,
4736 const char *symbol_name,
4737 const hsa_agent_t *agent,
4738 hsa_executable_symbol_t *symbol);
4739
4758
4773
4788
4803
4994
5018 hsa_executable_symbol_t executable_symbol,
5020 void *value);
5021
5049 hsa_executable_t executable,
5050 hsa_status_t (*callback)(hsa_executable_t exec,
5052 void *data),
5053 void *data);
5054
5083 hsa_executable_t executable,
5084 hsa_agent_t agent,
5085 hsa_status_t (*callback)(hsa_executable_t exec,
5086 hsa_agent_t agent,
5088 void *data),
5089 void *data);
5090
5116 hsa_executable_t executable,
5117 hsa_status_t (*callback)(hsa_executable_t exec,
5119 void *data),
5120 void *data);
5121
5144
5158
5206 hsa_code_object_t code_object,
5207 hsa_status_t (*alloc_callback)(size_t size,
5209 void **address),
5210 hsa_callback_data_t callback_data,
5211 const char *options,
5212 void **serialized_code_object,
5213 size_t *serialized_code_object_size);
5214
5246 void *serialized_code_object,
5247 size_t serialized_code_object_size,
5248 const char *options,
5249 hsa_code_object_t *code_object);
5250
5271 hsa_code_object_t code_object);
5272
5286
5328
5353 hsa_code_object_t code_object,
5354 hsa_code_object_info_t attribute,
5355 void *value);
5356
5409 hsa_executable_t executable,
5410 hsa_agent_t agent,
5411 hsa_code_object_t code_object,
5412 const char *options);
5413
5431
5458 hsa_code_object_t code_object,
5459 const char *symbol_name,
5460 hsa_code_symbol_t *symbol);
5461
5491 hsa_code_object_t code_object,
5492 const char *module_name,
5493 const char *symbol_name,
5494 hsa_code_symbol_t *symbol);
5495
5632
5657 hsa_code_symbol_t code_symbol,
5658 hsa_code_symbol_info_t attribute,
5659 void *value);
5660
5688 hsa_code_object_t code_object,
5689 hsa_status_t (*callback)(hsa_code_object_t code_object,
5690 hsa_code_symbol_t symbol,
5691 void *data),
5692 void *data);
5693
5696#ifdef __cplusplus
5697} // end extern "C" block
5698} // namespace gem5
5699#endif
5700
5701#endif // header guard
const char data[]
std::vector< SwitchingFiber * > expected({ &a, &b, &a, &a, &a, &b, &c, &a, &c, &c, &c })
hsa_status_t HSA_API hsa_cache_get_info(hsa_cache_t cache, hsa_cache_info_t attribute, void *value)
Get the current value of an attribute for a given cache object.
hsa_status_t HSA_API HSA_DEPRECATED hsa_system_extension_supported(uint16_t extension, uint16_t version_major, uint16_t version_minor, bool *result)
Query if a given version of an extension is supported by the HSA implementation.
hsa_agent_info_t
Agent attributes.
Definition hsa.h:792
hsa_cache_info_t
Cache attributes.
Definition hsa.h:1141
hsa_endianness_t
Endianness.
Definition hsa.h:397
hsa_machine_model_t
Machine model.
Definition hsa.h:413
hsa_system_info_t
System attributes.
Definition hsa.h:446
hsa_device_type_t
Hardware device type.
Definition hsa.h:751
hsa_status_t HSA_API hsa_agent_iterate_caches(hsa_agent_t agent, hsa_status_t(*callback)(hsa_cache_t cache, void *data), void *data)
Iterate over the memory caches of a given agent, and invoke an application-defined callback on every ...
hsa_extension_t
HSA extensions.
Definition hsa.h:514
hsa_status_t HSA_API hsa_iterate_agents(hsa_status_t(*callback)(hsa_agent_t agent, void *data), void *data)
Iterate over the available agents, and invoke an application-defined callback on every iteration.
hsa_status_t HSA_API hsa_system_get_major_extension_table(uint16_t extension, uint16_t version_major, size_t table_length, void *table)
Retrieve the function pointers corresponding to a given major version of an extension.
hsa_status_t HSA_API HSA_DEPRECATED hsa_agent_get_exception_policies(hsa_agent_t agent, hsa_profile_t profile, uint16_t *mask)
Retrieve the exception policy support for a given combination of agent and profile.
hsa_status_t HSA_API hsa_system_major_extension_supported(uint16_t extension, uint16_t version_major, uint16_t *version_minor, bool *result)
Query if a given version of an extension is supported by the HSA implementation.
struct hsa_agent_s hsa_agent_t
Struct containing an opaque handle to an agent, a device that participates in the HSA memory model.
hsa_status_t HSA_API hsa_system_get_info(hsa_system_info_t attribute, void *value)
Get the current value of a system attribute.
hsa_default_float_rounding_mode_t
Default floating-point rounding mode.
Definition hsa.h:770
hsa_status_t HSA_API HSA_DEPRECATED hsa_agent_extension_supported(uint16_t extension, hsa_agent_t agent, uint16_t version_major, uint16_t version_minor, bool *result)
Query if a given version of an extension is supported by an agent.
hsa_status_t HSA_API hsa_agent_major_extension_supported(uint16_t extension, hsa_agent_t agent, uint16_t version_major, uint16_t *version_minor, bool *result)
Query if a given version of an extension is supported by an agent.
hsa_profile_t
Profile.
Definition hsa.h:431
hsa_status_t HSA_API hsa_extension_get_name(uint16_t extension, const char **name)
Query the name of a given extension.
hsa_exception_policy_t
Exception policies applied in the presence of hardware exceptions.
Definition hsa.h:1082
hsa_agent_feature_t
Agent features.
Definition hsa.h:735
hsa_status_t HSA_API hsa_agent_get_info(hsa_agent_t agent, hsa_agent_info_t attribute, void *value)
Get the current value of an attribute for a given agent.
struct hsa_cache_s hsa_cache_t
Cache handle.
hsa_status_t HSA_API HSA_DEPRECATED hsa_system_get_extension_table(uint16_t extension, uint16_t version_major, uint16_t version_minor, void *table)
Retrieve the function pointers corresponding to a given version of an extension. Portable application...
@ HSA_AGENT_INFO_BASE_PROFILE_DEFAULT_FLOAT_ROUNDING_MODES
Definition hsa.h:852
@ HSA_AGENT_INFO_DEVICE
Type of hardware device associated with the agent.
Definition hsa.h:971
@ HSA_AGENT_INFO_VERSION_MAJOR
Major version of the HSA runtime specification supported by the agent.
Definition hsa.h:1001
@ HSA_AGENT_INFO_QUEUES_MAX
Definition hsa.h:941
@ HSA_AGENT_INFO_NAME
Agent name.
Definition hsa.h:798
@ HSA_AGENT_INFO_ISA
Definition hsa.h:990
@ HSA_AGENT_INFO_GRID_MAX_SIZE
Definition hsa.h:923
@ HSA_AGENT_INFO_WAVEFRONT_SIZE
Definition hsa.h:876
@ HSA_AGENT_INFO_FAST_F16_OPERATION
Definition hsa.h:864
@ HSA_AGENT_INFO_EXTENSIONS
Bit-mask indicating which extensions are supported by the agent.
Definition hsa.h:996
@ HSA_AGENT_INFO_QUEUE_TYPE
Type of a queue created in the agent.
Definition hsa.h:959
@ HSA_AGENT_INFO_FEATURE
Agent capability.
Definition hsa.h:808
@ HSA_AGENT_INFO_GRID_MAX_DIM
Definition hsa.h:912
@ HSA_AGENT_INFO_WORKGROUP_MAX_DIM
Definition hsa.h:889
@ HSA_AGENT_INFO_MACHINE_MODEL
Definition hsa.h:818
@ HSA_AGENT_INFO_NODE
Definition hsa.h:966
@ HSA_AGENT_INFO_FBARRIER_MAX_SIZE
Definition hsa.h:934
@ HSA_AGENT_INFO_VERSION_MINOR
Minor version of the HSA runtime specification supported by the agent.
Definition hsa.h:1006
@ HSA_AGENT_INFO_DEFAULT_FLOAT_ROUNDING_MODE
Definition hsa.h:839
@ HSA_AGENT_INFO_VENDOR_NAME
Name of vendor.
Definition hsa.h:804
@ HSA_AGENT_INFO_QUEUE_MAX_SIZE
Maximum number of packets that a queue created in the agent can hold.
Definition hsa.h:954
@ HSA_AGENT_INFO_PROFILE
Definition hsa.h:828
@ HSA_AGENT_INFO_QUEUE_MIN_SIZE
Minimum number of packets that a queue created in the agent can hold.
Definition hsa.h:948
@ HSA_AGENT_INFO_WORKGROUP_MAX_SIZE
Definition hsa.h:900
@ HSA_AGENT_INFO_CACHE_SIZE
Definition hsa.h:980
@ HSA_CACHE_INFO_NAME
Human-readable description.
Definition hsa.h:1152
@ HSA_CACHE_INFO_NAME_LENGTH
The length of the cache name in bytes, not including the NUL terminator.
Definition hsa.h:1146
@ HSA_CACHE_INFO_LEVEL
Cache level.
Definition hsa.h:1157
@ HSA_CACHE_INFO_SIZE
Cache size, in bytes.
Definition hsa.h:1162
@ HSA_ENDIANNESS_BIG
The most significant byte is stored in the smallest address.
Definition hsa.h:405
@ HSA_ENDIANNESS_LITTLE
The least significant byte is stored in the smallest address.
Definition hsa.h:401
@ HSA_MACHINE_MODEL_LARGE
Large machine model.
Definition hsa.h:421
@ HSA_MACHINE_MODEL_SMALL
Small machine model.
Definition hsa.h:417
@ HSA_SYSTEM_INFO_VERSION_MINOR
Minor version of the HSA runtime specification supported by the implementation.
Definition hsa.h:456
@ HSA_SYSTEM_INFO_EXTENSIONS
Bit-mask indicating which extensions are supported by the implementation.
Definition hsa.h:486
@ HSA_SYSTEM_INFO_SIGNAL_MAX_WAIT
Maximum duration of a signal wait operation.
Definition hsa.h:471
@ HSA_SYSTEM_INFO_MACHINE_MODEL
Machine model supported by the HSA runtime.
Definition hsa.h:480
@ HSA_SYSTEM_INFO_ENDIANNESS
Endianness of the system.
Definition hsa.h:475
@ HSA_SYSTEM_INFO_VERSION_MAJOR
Major version of the HSA runtime specification supported by the implementation.
Definition hsa.h:451
@ HSA_SYSTEM_INFO_TIMESTAMP
Current timestamp.
Definition hsa.h:461
@ HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY
Timestamp value increase rate, in Hz.
Definition hsa.h:466
@ HSA_DEVICE_TYPE_DSP
DSP device.
Definition hsa.h:763
@ HSA_DEVICE_TYPE_CPU
CPU device.
Definition hsa.h:755
@ HSA_DEVICE_TYPE_GPU
GPU device.
Definition hsa.h:759
@ HSA_EXTENSION_STD_LAST
Extension count.
Definition hsa.h:536
@ HSA_EXTENSION_FINALIZER
Finalizer extension.
Definition hsa.h:518
@ HSA_AMD_FIRST_EXTENSION
First AMD extension number.
Definition hsa.h:540
@ HSA_EXTENSION_PROFILING_EVENTS
Profiling events extension.
Definition hsa.h:532
@ HSA_EXTENSION_AMD_LOADER
Loader extension.
Definition hsa.h:548
@ HSA_AMD_LAST_EXTENSION
Last AMD extension.
Definition hsa.h:552
@ HSA_EXTENSION_IMAGES
Images extension.
Definition hsa.h:522
@ HSA_EXTENSION_PERFORMANCE_COUNTERS
Performance counter extension.
Definition hsa.h:527
@ HSA_EXTENSION_AMD_PROFILER
Profiler extension.
Definition hsa.h:544
@ HSA_DEFAULT_FLOAT_ROUNDING_MODE_NEAR
Operations that specify the default floating-point mode are rounded to the nearest representable numb...
Definition hsa.h:785
@ HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT
Use a default floating-point rounding mode specified elsewhere.
Definition hsa.h:774
@ HSA_DEFAULT_FLOAT_ROUNDING_MODE_ZERO
Operations that specify the default floating-point mode are rounded to zero by default.
Definition hsa.h:779
@ HSA_PROFILE_FULL
Full profile.
Definition hsa.h:439
@ HSA_PROFILE_BASE
Base profile.
Definition hsa.h:435
@ HSA_EXCEPTION_POLICY_DETECT
If a hardware exception is detected, a hardware status bit is set.
Definition hsa.h:1090
@ HSA_EXCEPTION_POLICY_BREAK
If a hardware exception is detected, a work-item signals an exception.
Definition hsa.h:1086
@ HSA_AGENT_FEATURE_AGENT_DISPATCH
The agent supports AQL packets of agent dispatch type.
Definition hsa.h:744
@ HSA_AGENT_FEATURE_KERNEL_DISPATCH
The agent supports AQL packets of kernel dispatch type.
Definition hsa.h:740
hsa_kernel_dispatch_packet_setup_t
Sub-fields of the kernel dispatch packet setup field.
Definition hsa.h:2880
struct hsa_agent_dispatch_packet_s hsa_agent_dispatch_packet_t
Agent dispatch packet.
hsa_packet_header_t
Sub-fields of the header field that is present in any AQL packet.
Definition hsa.h:2810
hsa_packet_type_t
Packet type.
Definition hsa.h:2746
hsa_fence_scope_t
Scope of the memory fence operation associated with a packet.
Definition hsa.h:2785
struct hsa_barrier_or_packet_s hsa_barrier_or_packet_t
Barrier-OR packet.
struct hsa_barrier_and_packet_s hsa_barrier_and_packet_t
Barrier-AND packet.
hsa_kernel_dispatch_packet_setup_width_t
Width (in bits) of the sub-fields in hsa_kernel_dispatch_packet_setup_t.
Definition hsa.h:2893
hsa_packet_header_width_t
Width (in bits) of the sub-fields in hsa_packet_header_t.
Definition hsa.h:2857
struct hsa_kernel_dispatch_packet_s hsa_kernel_dispatch_packet_t
AQL kernel dispatch packet.
@ HSA_KERNEL_DISPATCH_PACKET_SETUP_DIMENSIONS
Number of dimensions of the grid.
Definition hsa.h:2885
@ HSA_PACKET_HEADER_SCACQUIRE_FENCE_SCOPE
Acquire fence scope.
Definition hsa.h:2832
@ HSA_PACKET_HEADER_RELEASE_FENCE_SCOPE
Definition hsa.h:2850
@ HSA_PACKET_HEADER_TYPE
Packet type.
Definition hsa.h:2816
@ HSA_PACKET_HEADER_SCRELEASE_FENCE_SCOPE
Release fence scope, The value of this sub-field determines the scope and type of the memory fence op...
Definition hsa.h:2846
@ HSA_PACKET_HEADER_BARRIER
Barrier bit.
Definition hsa.h:2822
@ HSA_PACKET_HEADER_ACQUIRE_FENCE_SCOPE
Definition hsa.h:2836
@ HSA_PACKET_TYPE_BARRIER_AND
Packet used by agents to delay processing of subsequent packets, and to express complex dependencies ...
Definition hsa.h:2767
@ HSA_PACKET_TYPE_BARRIER_OR
Packet used by agents to delay processing of subsequent packets, and to express complex dependencies ...
Definition hsa.h:2778
@ HSA_PACKET_TYPE_VENDOR_SPECIFIC
Vendor-specific packet.
Definition hsa.h:2750
@ HSA_PACKET_TYPE_INVALID
The packet has been processed in the past, but has not been reassigned to the packet processor.
Definition hsa.h:2756
@ HSA_PACKET_TYPE_KERNEL_DISPATCH
Packet used by agents for dispatching jobs to kernel agents.
Definition hsa.h:2761
@ HSA_PACKET_TYPE_AGENT_DISPATCH
Packet used by agents for dispatching jobs to agents.
Definition hsa.h:2772
@ HSA_FENCE_SCOPE_NONE
No scope (no fence is applied).
Definition hsa.h:2790
@ HSA_FENCE_SCOPE_SYSTEM
The fence is applied across both agent and system scope for the global segment.
Definition hsa.h:2799
@ HSA_FENCE_SCOPE_AGENT
The fence is applied with agent scope for the global segment.
Definition hsa.h:2794
@ HSA_KERNEL_DISPATCH_PACKET_SETUP_WIDTH_DIMENSIONS
Definition hsa.h:2894
@ HSA_PACKET_HEADER_WIDTH_SCRELEASE_FENCE_SCOPE
Definition hsa.h:2865
@ HSA_PACKET_HEADER_WIDTH_SCACQUIRE_FENCE_SCOPE
Definition hsa.h:2860
@ HSA_PACKET_HEADER_WIDTH_BARRIER
Definition hsa.h:2859
@ HSA_PACKET_HEADER_WIDTH_TYPE
Definition hsa.h:2858
@ HSA_PACKET_HEADER_WIDTH_ACQUIRE_FENCE_SCOPE
Definition hsa.h:2864
@ HSA_PACKET_HEADER_WIDTH_RELEASE_FENCE_SCOPE
Definition hsa.h:2869
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_get_symbol(hsa_code_object_t code_object, const char *symbol_name, hsa_code_symbol_t *symbol)
Get the symbol handle within a code object for a given a symbol name.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_get_symbol_from_name(hsa_code_object_t code_object, const char *module_name, const char *symbol_name, hsa_code_symbol_t *symbol)
Get the symbol handle within a code object for a given a symbol name.
struct hsa_code_symbol_s hsa_code_symbol_t
Code object symbol handle.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_iterate_symbols(hsa_code_object_t code_object, hsa_status_t(*callback)(hsa_code_object_t code_object, hsa_code_symbol_t symbol, void *data), void *data)
Iterate over the symbols in a code object, and invoke an application-defined callback on every iterat...
hsa_code_object_info_t
Code object attributes.
Definition hsa.h:5293
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_get_info(hsa_code_object_t code_object, hsa_code_object_info_t attribute, void *value)
Get the current value of an attribute for a given code object.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_deserialize(void *serialized_code_object, size_t serialized_code_object_size, const char *options, hsa_code_object_t *code_object)
Deserialize a code object.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_symbol_get_info(hsa_code_symbol_t code_symbol, hsa_code_symbol_info_t attribute, void *value)
Get the current value of an attribute for a given code symbol.
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_serialize(hsa_code_object_t code_object, hsa_status_t(*alloc_callback)(size_t size, hsa_callback_data_t data, void **address), hsa_callback_data_t callback_data, const char *options, void **serialized_code_object, size_t *serialized_code_object_size)
Serialize a code object. Can be used for offline finalization, install-time finalization,...
hsa_status_t HSA_API HSA_DEPRECATED hsa_code_object_destroy(hsa_code_object_t code_object)
Destroy a code object.
struct hsa_callback_data_s hsa_callback_data_t
Application data handle that is passed to the serialization and deserialization functions.
hsa_status_t HSA_API HSA_DEPRECATED hsa_executable_load_code_object(hsa_executable_t executable, hsa_agent_t agent, hsa_code_object_t code_object, const char *options)
Load code object into the executable.
hsa_code_symbol_info_t
Code object symbol attributes.
Definition hsa.h:5502
hsa_code_object_type_t
Code object type.
Definition hsa.h:5279
struct hsa_code_object_s hsa_code_object_t
Struct containing an opaque handle to a code object, which contains ISA for finalized kernels and ind...
@ HSA_CODE_OBJECT_INFO_MACHINE_MODEL
Machine model this code object is produced for.
Definition hsa.h:5315
@ HSA_CODE_OBJECT_INFO_DEFAULT_FLOAT_ROUNDING_MODE
Default floating-point rounding mode used when the code object is produced.
Definition hsa.h:5326
@ HSA_CODE_OBJECT_INFO_TYPE
Type of code object.
Definition hsa.h:5305
@ HSA_CODE_OBJECT_INFO_VERSION
The version of the code object.
Definition hsa.h:5300
@ HSA_CODE_OBJECT_INFO_ISA
Instruction set architecture this code object is produced for.
Definition hsa.h:5310
@ HSA_CODE_OBJECT_INFO_PROFILE
Profile this code object is produced for.
Definition hsa.h:5320
@ HSA_CODE_SYMBOL_INFO_VARIABLE_SIZE
Size of the variable.
Definition hsa.h:5568
@ HSA_CODE_SYMBOL_INFO_MODULE_NAME_LENGTH
The length of the module name in bytes (not including the NUL terminator) to which this symbol belong...
Definition hsa.h:5523
@ HSA_CODE_SYMBOL_INFO_VARIABLE_ALLOCATION
The allocation kind of the variable.
Definition hsa.h:5546
@ HSA_CODE_SYMBOL_INFO_LINKAGE
The linkage kind of the symbol.
Definition hsa.h:5535
@ HSA_CODE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE
Size of static group segment memory required by the kernel (per work-group), in bytes.
Definition hsa.h:5598
@ HSA_CODE_SYMBOL_INFO_NAME
The name of the symbol.
Definition hsa.h:5517
@ HSA_CODE_SYMBOL_INFO_VARIABLE_IS_CONST
Indicates whether the variable is constant.
Definition hsa.h:5574
@ HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT
Alignment (in bytes) of the buffer used to pass arguments to the kernel, which is the maximum of 16 a...
Definition hsa.h:5588
@ HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE
Size of kernarg segment memory that is required to hold the values of the kernel arguments,...
Definition hsa.h:5581
@ HSA_CODE_SYMBOL_INFO_TYPE
The type of the symbol.
Definition hsa.h:5506
@ HSA_CODE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION
Call convention of the indirect function.
Definition hsa.h:5630
@ HSA_CODE_SYMBOL_INFO_VARIABLE_ALIGNMENT
Alignment of the symbol in memory.
Definition hsa.h:5560
@ HSA_CODE_SYMBOL_INFO_NAME_LENGTH
The length of the symbol name in bytes, not including the NUL terminator.
Definition hsa.h:5511
@ HSA_CODE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE
Size of static private, spill, and arg segment memory required by this kernel (per work-item),...
Definition hsa.h:5610
@ HSA_CODE_SYMBOL_INFO_VARIABLE_SEGMENT
The segment kind of the variable.
Definition hsa.h:5552
@ HSA_CODE_SYMBOL_INFO_KERNEL_CALL_CONVENTION
Call convention of the kernel.
Definition hsa.h:5624
@ HSA_CODE_SYMBOL_INFO_MODULE_NAME
The module name to which this symbol belongs if this symbol has module linkage, otherwise an empty st...
Definition hsa.h:5530
@ HSA_CODE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK
Dynamic callstack flag.
Definition hsa.h:5619
@ HSA_CODE_SYMBOL_INFO_IS_DEFINITION
Indicates whether the symbol corresponds to a definition.
Definition hsa.h:5540
@ HSA_CODE_OBJECT_TYPE_PROGRAM
Produces code object that contains ISA for all kernels and indirect functions in HSA source.
Definition hsa.h:5284
hsa_access_permission_t
Access permissions.
Definition hsa.h:318
struct hsa_dim3_s hsa_dim3_t
Three-dimensional coordinate.
int hsa_file_t
POSIX file descriptor.
Definition hsa.h:336
@ HSA_ACCESS_PERMISSION_WO
Write-only access.
Definition hsa.h:326
@ HSA_ACCESS_PERMISSION_RW
Read and write access.
Definition hsa.h:330
@ HSA_ACCESS_PERMISSION_RO
Read-only access.
Definition hsa.h:322
hsa_variable_allocation_t
Allocation type of a variable.
Definition hsa.h:4778
hsa_status_t HSA_API HSA_DEPRECATED hsa_executable_iterate_symbols(hsa_executable_t executable, hsa_status_t(*callback)(hsa_executable_t exec, hsa_executable_symbol_t symbol, void *data), void *data)
Iterate over the symbols in a executable, and invoke an application-defined callback on every iterati...
hsa_status_t HSA_API hsa_executable_get_info(hsa_executable_t executable, hsa_executable_info_t attribute, void *value)
Get the current value of an attribute for a given executable.
hsa_executable_info_t
Executable attributes.
Definition hsa.h:4402
hsa_executable_symbol_info_t
Executable symbol attributes.
Definition hsa.h:4808
hsa_status_t HSA_API hsa_executable_create_alt(hsa_profile_t profile, hsa_default_float_rounding_mode_t default_float_rounding_mode, const char *options, hsa_executable_t *executable)
Create an empty executable.
struct hsa_loaded_code_object_s hsa_loaded_code_object_t
Loaded code object handle.
hsa_status_t HSA_API hsa_executable_validate_alt(hsa_executable_t executable, const char *options, uint32_t *result)
Validate an executable.
hsa_status_t HSA_API hsa_executable_freeze(hsa_executable_t executable, const char *options)
Freeze the executable.
hsa_status_t HSA_API hsa_executable_iterate_agent_symbols(hsa_executable_t executable, hsa_agent_t agent, hsa_status_t(*callback)(hsa_executable_t exec, hsa_agent_t agent, hsa_executable_symbol_t symbol, void *data), void *data)
Iterate over the kernels, indirect functions, and agent allocation variables in an executable for a g...
hsa_status_t HSA_API hsa_executable_agent_global_variable_define(hsa_executable_t executable, hsa_agent_t agent, const char *variable_name, void *address)
Define an external global variable with agent allocation.
struct hsa_executable_s hsa_executable_t
Struct containing an opaque handle to an executable, which contains ISA for finalized kernels and ind...
hsa_status_t HSA_API hsa_executable_get_symbol_by_name(hsa_executable_t executable, const char *symbol_name, const hsa_agent_t *agent, hsa_executable_symbol_t *symbol)
Retrieve the symbol handle corresponding to a given a symbol name.
hsa_symbol_kind_t
Symbol type.
Definition hsa.h:4744
hsa_status_t HSA_API HSA_DEPRECATED hsa_executable_create(hsa_profile_t profile, hsa_executable_state_t executable_state, const char *options, hsa_executable_t *executable)
Create an empty executable.
hsa_status_t HSA_API hsa_executable_validate(hsa_executable_t executable, uint32_t *result)
Validate an executable.
hsa_status_t HSA_API hsa_executable_symbol_get_info(hsa_executable_symbol_t executable_symbol, hsa_executable_symbol_info_t attribute, void *value)
Get the current value of an attribute for a given executable symbol.
hsa_status_t HSA_API hsa_executable_global_variable_define(hsa_executable_t executable, const char *variable_name, void *address)
Define an external global variable with program allocation.
hsa_status_t HSA_API hsa_executable_load_agent_code_object(hsa_executable_t executable, hsa_agent_t agent, hsa_code_object_reader_t code_object_reader, const char *options, hsa_loaded_code_object_t *loaded_code_object)
Load an agent code object into an executable.
hsa_variable_segment_t
Memory segment associated with a variable.
Definition hsa.h:4793
hsa_status_t HSA_API hsa_executable_destroy(hsa_executable_t executable)
Destroy an executable.
struct hsa_code_object_reader_s hsa_code_object_reader_t
Code object reader handle.
struct hsa_executable_symbol_s hsa_executable_symbol_t
Executable symbol handle.
hsa_status_t HSA_API hsa_code_object_reader_create_from_memory(const void *code_object, size_t size, hsa_code_object_reader_t *code_object_reader)
Create a code object reader to operate on memory.
hsa_status_t HSA_API hsa_executable_load_program_code_object(hsa_executable_t executable, hsa_code_object_reader_t code_object_reader, const char *options, hsa_loaded_code_object_t *loaded_code_object)
Load a program code object into an executable.
hsa_status_t HSA_API hsa_executable_readonly_variable_define(hsa_executable_t executable, hsa_agent_t agent, const char *variable_name, void *address)
Define an external readonly variable.
hsa_status_t HSA_API HSA_DEPRECATED hsa_executable_get_symbol(hsa_executable_t executable, const char *module_name, const char *symbol_name, hsa_agent_t agent, int32_t call_convention, hsa_executable_symbol_t *symbol)
Get the symbol handle for a given a symbol name.
hsa_status_t HSA_API hsa_code_object_reader_create_from_file(hsa_file_t file, hsa_code_object_reader_t *code_object_reader)
Create a code object reader to operate on a file.
hsa_status_t HSA_API hsa_code_object_reader_destroy(hsa_code_object_reader_t code_object_reader)
Destroy a code object reader.
hsa_status_t HSA_API hsa_executable_iterate_program_symbols(hsa_executable_t executable, hsa_status_t(*callback)(hsa_executable_t exec, hsa_executable_symbol_t symbol, void *data), void *data)
Iterate over the program allocation variables in an executable, and invoke an application-defined cal...
hsa_symbol_linkage_t
Linkage type of a symbol.
Definition hsa.h:4763
hsa_executable_state_t
Executable state.
Definition hsa.h:4120
@ HSA_VARIABLE_ALLOCATION_AGENT
Agent allocation.
Definition hsa.h:4782
@ HSA_VARIABLE_ALLOCATION_PROGRAM
Program allocation.
Definition hsa.h:4786
@ HSA_EXECUTABLE_INFO_STATE
Executable state.
Definition hsa.h:4411
@ HSA_EXECUTABLE_INFO_DEFAULT_FLOAT_ROUNDING_MODE
Default floating-point rounding mode specified when executable was created.
Definition hsa.h:4416
@ HSA_EXECUTABLE_INFO_PROFILE
Profile this executable is created for.
Definition hsa.h:4407
@ HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME_LENGTH
Definition hsa.h:4831
@ HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME
Definition hsa.h:4840
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_SIZE
Definition hsa.h:4903
@ HSA_EXECUTABLE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION
Definition hsa.h:4992
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE
Size of kernarg segment memory that is required to hold the values of the kernel arguments,...
Definition hsa.h:4927
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK
Dynamic callstack flag.
Definition hsa.h:4965
@ HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH
The length of the symbol name in bytes, not including the NUL terminator.
Definition hsa.h:4817
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALIGNMENT
Definition hsa.h:4893
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT
Alignment (in bytes) of the buffer used to pass arguments to the kernel, which is the maximum of 16 a...
Definition hsa.h:4934
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_OBJECT
Kernel object handle, used in the kernel dispatch packet.
Definition hsa.h:4920
@ HSA_EXECUTABLE_SYMBOL_INFO_AGENT
Definition hsa.h:4849
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE
Size of static group segment memory required by the kernel (per work-group), in bytes.
Definition hsa.h:4944
@ HSA_EXECUTABLE_SYMBOL_INFO_TYPE
The kind of the symbol.
Definition hsa.h:4812
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALLOCATION
Definition hsa.h:4875
@ HSA_EXECUTABLE_SYMBOL_INFO_IS_DEFINITION
Indicates whether the symbol corresponds to a definition.
Definition hsa.h:4867
@ HSA_EXECUTABLE_SYMBOL_INFO_NAME
The name of the symbol.
Definition hsa.h:4823
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_IS_CONST
Definition hsa.h:4911
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_SEGMENT
Definition hsa.h:4883
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE
Size of static private, spill, and arg segment memory required by this kernel (per work-item),...
Definition hsa.h:4956
@ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ADDRESS
The address of the variable.
Definition hsa.h:4857
@ HSA_EXECUTABLE_SYMBOL_INFO_LINKAGE
The linkage kind of the symbol.
Definition hsa.h:4862
@ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_CALL_CONVENTION
Definition hsa.h:4972
@ HSA_EXECUTABLE_SYMBOL_INFO_INDIRECT_FUNCTION_OBJECT
Indirect function object handle.
Definition hsa.h:4983
@ HSA_SYMBOL_KIND_INDIRECT_FUNCTION
Indirect function.
Definition hsa.h:4756
@ HSA_SYMBOL_KIND_VARIABLE
Variable.
Definition hsa.h:4748
@ HSA_SYMBOL_KIND_KERNEL
Kernel.
Definition hsa.h:4752
@ HSA_VARIABLE_SEGMENT_READONLY
Readonly memory segment.
Definition hsa.h:4801
@ HSA_VARIABLE_SEGMENT_GLOBAL
Global memory segment.
Definition hsa.h:4797
@ HSA_SYMBOL_LINKAGE_PROGRAM
Program linkage.
Definition hsa.h:4771
@ HSA_SYMBOL_LINKAGE_MODULE
Module linkage.
Definition hsa.h:4767
@ HSA_EXECUTABLE_STATE_UNFROZEN
Executable state, which allows the user to load code objects and define external variables.
Definition hsa.h:4127
@ HSA_EXECUTABLE_STATE_FROZEN
Executable state, which allows the user to query variable addresses, kernel code handles,...
Definition hsa.h:4134
hsa_status_t HSA_API hsa_init()
Initialize the HSA runtime.
hsa_status_t HSA_API hsa_shut_down()
Shut down the HSA runtime.
hsa_wavefront_info_t
Wavefront attributes.
Definition hsa.h:3907
struct hsa_wavefront_s hsa_wavefront_t
Wavefront handle.
struct hsa_isa_s hsa_isa_t
Instruction set architecture.
hsa_status_t HSA_API hsa_isa_from_name(const char *name, hsa_isa_t *isa)
Retrieve a reference to an instruction set architecture handle out of a symbolic name.
hsa_status_t HSA_API HSA_DEPRECATED hsa_isa_get_info(hsa_isa_t isa, hsa_isa_info_t attribute, uint32_t index, void *value)
Get the current value of an attribute for a given instruction set architecture (ISA).
hsa_status_t HSA_API hsa_isa_get_info_alt(hsa_isa_t isa, hsa_isa_info_t attribute, void *value)
Get the current value of an attribute for a given instruction set architecture (ISA).
hsa_status_t HSA_API hsa_agent_iterate_isas(hsa_agent_t agent, hsa_status_t(*callback)(hsa_isa_t isa, void *data), void *data)
Iterate over the instruction sets supported by the given agent, and invoke an application-defined cal...
hsa_isa_info_t
Instruction set architecture attributes.
Definition hsa.h:3602
hsa_status_t HSA_API hsa_isa_iterate_wavefronts(hsa_isa_t isa, hsa_status_t(*callback)(hsa_wavefront_t wavefront, void *data), void *data)
Iterate over the different wavefronts supported by an instruction set architecture,...
hsa_status_t HSA_API HSA_DEPRECATED hsa_isa_compatible(hsa_isa_t code_object_isa, hsa_isa_t agent_isa, bool *result)
Check if the instruction set architecture of a code object can be executed on an agent associated wit...
hsa_status_t HSA_API hsa_wavefront_get_info(hsa_wavefront_t wavefront, hsa_wavefront_info_t attribute, void *value)
Get the current value of a wavefront attribute.
hsa_status_t HSA_API hsa_isa_get_exception_policies(hsa_isa_t isa, hsa_profile_t profile, uint16_t *mask)
Retrieve the exception policy support for a given combination of instruction set architecture and pro...
hsa_flush_mode_t
Flush to zero modes.
Definition hsa.h:3832
hsa_round_method_t
Round methods.
Definition hsa.h:3847
hsa_status_t HSA_API hsa_isa_get_round_method(hsa_isa_t isa, hsa_fp_type_t fp_type, hsa_flush_mode_t flush_mode, hsa_round_method_t *round_method)
Retrieve the round method (single or double) used to implement the floating-point multiply add instru...
hsa_fp_type_t
Floating-point types.
Definition hsa.h:3813
@ HSA_WAVEFRONT_INFO_SIZE
Number of work-items in the wavefront.
Definition hsa.h:3912
@ HSA_ISA_INFO_GRID_MAX_SIZE
Maximum total number of work-items in a grid.
Definition hsa.h:3702
@ HSA_ISA_INFO_FAST_F16_OPERATION
Flag indicating that the f16 HSAIL operation is at least as fast as the f32 operation in the instruct...
Definition hsa.h:3677
@ HSA_ISA_INFO_DEFAULT_FLOAT_ROUNDING_MODES
Default floating-point rounding modes supported by the instruction set architecture.
Definition hsa.h:3661
@ HSA_ISA_INFO_BASE_PROFILE_DEFAULT_FLOAT_ROUNDING_MODES
Default floating-point rounding modes supported by the instruction set architecture in the Base profi...
Definition hsa.h:3671
@ HSA_ISA_INFO_MACHINE_MODELS
Machine models supported by the instruction set architecture.
Definition hsa.h:3642
@ HSA_ISA_INFO_CALL_CONVENTION_INFO_WAVEFRONT_SIZE
Definition hsa.h:3626
@ HSA_ISA_INFO_WORKGROUP_MAX_SIZE
Maximum total number of work-items in a work-group.
Definition hsa.h:3689
@ HSA_ISA_INFO_GRID_MAX_DIM
Maximum number of work-items of each dimension of a grid.
Definition hsa.h:3697
@ HSA_ISA_INFO_WORKGROUP_MAX_DIM
Maximum number of work-items of each dimension of a work-group.
Definition hsa.h:3684
@ HSA_ISA_INFO_FBARRIER_MAX_SIZE
Maximum number of fbarriers per work-group.
Definition hsa.h:3707
@ HSA_ISA_INFO_NAME
Human-readable description.
Definition hsa.h:3612
@ HSA_ISA_INFO_CALL_CONVENTION_COUNT
Definition hsa.h:3619
@ HSA_ISA_INFO_CALL_CONVENTION_INFO_WAVEFRONTS_PER_COMPUTE_UNIT
Definition hsa.h:3635
@ HSA_ISA_INFO_NAME_LENGTH
The length of the ISA name in bytes, not including the NUL terminator.
Definition hsa.h:3607
@ HSA_ISA_INFO_PROFILES
Profiles supported by the instruction set architecture.
Definition hsa.h:3649
@ HSA_FLUSH_MODE_FTZ
Flush to zero.
Definition hsa.h:3836
@ HSA_FLUSH_MODE_NON_FTZ
Do not flush to zero.
Definition hsa.h:3840
@ HSA_ROUND_METHOD_SINGLE
Single round method.
Definition hsa.h:3851
@ HSA_ROUND_METHOD_DOUBLE
Double round method.
Definition hsa.h:3855
@ HSA_FP_TYPE_32
32-bit floating-point type.
Definition hsa.h:3821
@ HSA_FP_TYPE_64
64-bit floating-point type.
Definition hsa.h:3825
@ HSA_FP_TYPE_16
16-bit floating-point type.
Definition hsa.h:3817
hsa_status_t HSA_API hsa_memory_register(void *ptr, size_t size)
Register a global, fine-grained buffer.
hsa_status_t HSA_API hsa_memory_allocate(hsa_region_t region, size_t size, void **ptr)
Allocate a block of memory in a given region.
hsa_status_t HSA_API hsa_memory_copy(void *dst, const void *src, size_t size)
Copy a block of memory from the location pointed to by src to the memory block pointed to by dst.
hsa_region_segment_t
Memory segments associated with a region.
Definition hsa.h:3156
struct hsa_region_s hsa_region_t
A memory region represents a block of virtual memory with certain properties.
hsa_status_t HSA_API hsa_region_get_info(hsa_region_t region, hsa_region_info_t attribute, void *value)
Get the current value of an attribute of a region.
hsa_status_t HSA_API hsa_memory_assign_agent(void *ptr, hsa_agent_t agent, hsa_access_permission_t access)
Change the ownership of a global, coarse-grained buffer.
hsa_region_global_flag_t
Global region flags.
Definition hsa.h:3185
hsa_region_info_t
Attributes of a memory region.
Definition hsa.h:3211
hsa_status_t HSA_API hsa_agent_iterate_regions(hsa_agent_t agent, hsa_status_t(*callback)(hsa_region_t region, void *data), void *data)
Iterate over the memory regions associated with a given agent, and invoke an application-defined call...
hsa_status_t HSA_API hsa_memory_deregister(void *ptr, size_t size)
Deregister memory previously registered using hsa_memory_register.
hsa_status_t HSA_API hsa_memory_free(void *ptr)
Deallocate a block of memory previously allocated using hsa_memory_allocate.
@ HSA_REGION_SEGMENT_KERNARG
Kernarg segment.
Definition hsa.h:3178
@ HSA_REGION_SEGMENT_PRIVATE
Private segment.
Definition hsa.h:3169
@ HSA_REGION_SEGMENT_READONLY
Read-only segment.
Definition hsa.h:3165
@ HSA_REGION_SEGMENT_GROUP
Group segment.
Definition hsa.h:3174
@ HSA_REGION_SEGMENT_GLOBAL
Global segment.
Definition hsa.h:3160
@ HSA_REGION_GLOBAL_FLAG_COARSE_GRAINED
Updates to memory in this region can be performed by a single agent at a time.
Definition hsa.h:3204
@ HSA_REGION_GLOBAL_FLAG_FINE_GRAINED
Updates to memory in this region are immediately visible to all the agents under the terms of the HSA...
Definition hsa.h:3197
@ HSA_REGION_GLOBAL_FLAG_KERNARG
The application can use memory in the region to store kernel arguments, and provide the values for th...
Definition hsa.h:3191
@ HSA_REGION_INFO_SIZE
Size of this region, in bytes.
Definition hsa.h:3227
@ HSA_REGION_INFO_GLOBAL_FLAGS
Flag mask.
Definition hsa.h:3223
@ HSA_REGION_INFO_ALLOC_MAX_PRIVATE_WORKGROUP_SIZE
Maximum size (per work-group) of private memory that can be requested for a specific kernel dispatch.
Definition hsa.h:3248
@ HSA_REGION_INFO_RUNTIME_ALLOC_GRANULE
Allocation granularity of buffers allocated by hsa_memory_allocate in this region.
Definition hsa.h:3264
@ HSA_REGION_INFO_SEGMENT
Segment where memory in the region can be used.
Definition hsa.h:3216
@ HSA_REGION_INFO_RUNTIME_ALLOC_ALIGNMENT
Alignment of buffers allocated by hsa_memory_allocate in this region.
Definition hsa.h:3271
@ HSA_REGION_INFO_ALLOC_MAX_SIZE
Maximum allocation size in this region, in bytes.
Definition hsa.h:3241
@ HSA_REGION_INFO_RUNTIME_ALLOC_ALLOWED
Indicates whether memory in this region can be allocated using hsa_memory_allocate.
Definition hsa.h:3256
uint64_t HSA_API hsa_queue_load_write_index_relaxed(const hsa_queue_t *queue)
Atomically load the write index of a queue.
hsa_queue_feature_t
Queue features.
Definition hsa.h:2222
uint64_t HSA_API hsa_queue_cas_write_index_scacq_screl(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
Atomically set the write index of a queue if the observed value is equal to the expected value.
hsa_status_t HSA_API hsa_queue_destroy(hsa_queue_t *queue)
Destroy a user mode queue.
uint64_t HSA_API hsa_queue_cas_write_index_scacquire(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
Atomically set the write index of a queue if the observed value is equal to the expected value.
uint64_t HSA_API hsa_queue_load_write_index_scacquire(const hsa_queue_t *queue)
Atomically load the write index of a queue.
hsa_status_t HSA_API hsa_soft_queue_create(hsa_region_t region, uint32_t size, hsa_queue_type32_t type, uint32_t features, hsa_signal_t doorbell_signal, hsa_queue_t **queue)
Create a queue for which the application or a kernel is responsible for processing the AQL packets.
uint64_t HSA_API hsa_queue_cas_write_index_relaxed(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
Atomically set the write index of a queue if the observed value is equal to the expected value.
void HSA_API hsa_queue_store_read_index_screlease(const hsa_queue_t *queue, uint64_t value)
Atomically set the read index of a queue.
uint64_t HSA_API hsa_queue_add_write_index_screlease(const hsa_queue_t *queue, uint64_t value)
Atomically increment the write index of a queue by an offset.
uint32_t hsa_queue_type32_t
A fixed-size type used to represent hsa_queue_type_t constants.
Definition hsa.h:2216
uint64_t HSA_API hsa_queue_add_write_index_scacq_screl(const hsa_queue_t *queue, uint64_t value)
Atomically increment the write index of a queue by an offset.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_cas_write_index_acquire(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
hsa_status_t HSA_API hsa_queue_create(hsa_agent_t agent, uint32_t size, hsa_queue_type32_t type, void(*callback)(hsa_status_t status, hsa_queue_t *source, void *data), void *data, uint32_t private_segment_size, uint32_t group_segment_size, hsa_queue_t **queue)
Create a user mode queue.
void HSA_API HSA_DEPRECATED hsa_queue_store_write_index_release(const hsa_queue_t *queue, uint64_t value)
void HSA_API hsa_queue_store_write_index_relaxed(const hsa_queue_t *queue, uint64_t value)
Atomically set the write index of a queue.
uint64_t HSA_API hsa_queue_load_read_index_relaxed(const hsa_queue_t *queue)
Atomically load the read index of a queue.
uint64_t HSA_API hsa_queue_cas_write_index_screlease(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
Atomically set the write index of a queue if the observed value is equal to the expected value.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_add_write_index_acq_rel(const hsa_queue_t *queue, uint64_t value)
uint64_t HSA_API HSA_DEPRECATED hsa_queue_cas_write_index_release(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
struct hsa_queue_s hsa_queue_t
User mode queue.
uint64_t HSA_API hsa_queue_add_write_index_relaxed(const hsa_queue_t *queue, uint64_t value)
Atomically increment the write index of a queue by an offset.
uint64_t HSA_API hsa_queue_add_write_index_scacquire(const hsa_queue_t *queue, uint64_t value)
Atomically increment the write index of a queue by an offset.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_cas_write_index_acq_rel(const hsa_queue_t *queue, uint64_t expected, uint64_t value)
hsa_status_t HSA_API hsa_queue_inactivate(hsa_queue_t *queue)
Inactivate a queue.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_add_write_index_release(const hsa_queue_t *queue, uint64_t value)
void HSA_API hsa_queue_store_write_index_screlease(const hsa_queue_t *queue, uint64_t value)
Atomically set the write index of a queue.
uint64_t HSA_API HSA_DEPRECATED hsa_queue_load_read_index_acquire(const hsa_queue_t *queue)
uint64_t HSA_API HSA_DEPRECATED hsa_queue_add_write_index_acquire(const hsa_queue_t *queue, uint64_t value)
uint64_t HSA_API HSA_DEPRECATED hsa_queue_load_write_index_acquire(const hsa_queue_t *queue)
void HSA_API hsa_queue_store_read_index_relaxed(const hsa_queue_t *queue, uint64_t value)
Atomically set the read index of a queue.
hsa_queue_type_t
Queue type.
Definition hsa.h:2199
void HSA_API HSA_DEPRECATED hsa_queue_store_read_index_release(const hsa_queue_t *queue, uint64_t value)
uint64_t HSA_API hsa_queue_load_read_index_scacquire(const hsa_queue_t *queue)
Atomically load the read index of a queue.
@ HSA_QUEUE_FEATURE_KERNEL_DISPATCH
Queue supports kernel dispatch packets.
Definition hsa.h:2226
@ HSA_QUEUE_FEATURE_AGENT_DISPATCH
Queue supports agent dispatch packets.
Definition hsa.h:2231
@ HSA_QUEUE_TYPE_SINGLE
Queue only supports a single producer.
Definition hsa.h:2210
@ HSA_QUEUE_TYPE_MULTI
Queue supports multiple producers.
Definition hsa.h:2203
struct hsa_signal_s hsa_signal_t
Signal handle.
void HSA_API hsa_signal_xor_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise XOR operation between the value of a signal and a given value.
hsa_signal_value_t HSA_API hsa_signal_exchange_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal and return its previous value.
void HSA_API HSA_DEPRECATED hsa_signal_add_acquire(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API hsa_signal_store_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal.
void HSA_API hsa_signal_and_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise AND operation between the value of a signal and a given value.
void HSA_API hsa_signal_add_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically increment the value of a signal by a given amount.
hsa_signal_value_t HSA_API hsa_signal_load_relaxed(hsa_signal_t signal)
Atomically read the current value of a signal.
void HSA_API hsa_signal_xor_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise XOR operation between the value of a signal and a given value.
void HSA_API HSA_DEPRECATED hsa_signal_or_release(hsa_signal_t signal, hsa_signal_value_t value)
hsa_status_t HSA_API hsa_signal_destroy(hsa_signal_t signal)
Destroy a signal previous created by hsa_signal_create.
void HSA_API hsa_signal_or_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise OR operation between the value of a signal and a given value.
hsa_signal_value_t HSA_API hsa_signal_cas_relaxed(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
Atomically set the value of a signal if the observed value is equal to the expected value.
void HSA_API hsa_signal_or_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise OR operation between the value of a signal and a given value.
void HSA_API HSA_DEPRECATED hsa_signal_subtract_release(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API hsa_signal_wait_relaxed(hsa_signal_t signal, hsa_signal_condition_t condition, hsa_signal_value_t compare_value, uint64_t timeout_hint, hsa_wait_state_t wait_state_hint)
Wait until a signal value satisfies a specified condition, or a certain amount of time has elapsed.
void HSA_API HSA_DEPRECATED hsa_signal_or_acquire(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API hsa_signal_cas_scacq_screl(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
Atomically set the value of a signal if the observed value is equal to the expected value.
void HSA_API HSA_DEPRECATED hsa_signal_and_release(hsa_signal_t signal, hsa_signal_value_t value)
hsa_status_t HSA_API hsa_signal_group_wait_any_relaxed(hsa_signal_group_t signal_group, const hsa_signal_condition_t *conditions, const hsa_signal_value_t *compare_values, hsa_wait_state_t wait_state_hint, hsa_signal_t *signal, hsa_signal_value_t *value)
Wait until the value of at least one of the signals in a signal group satisfies its associated condit...
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_cas_acq_rel(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
void HSA_API hsa_signal_subtract_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically decrement the value of a signal by a given amount.
void HSA_API hsa_signal_subtract_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically decrement the value of a signal by a given amount.
void HSA_API HSA_DEPRECATED hsa_signal_and_acquire(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_exchange_release(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API hsa_signal_xor_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise XOR operation between the value of a signal and a given value.
int32_t hsa_signal_value_t
Signal value.
Definition hsa.h:1322
void HSA_API hsa_signal_or_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise OR operation between the value of a signal and a given value.
void HSA_API hsa_signal_silent_store_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal without necessarily notifying the the agents waiting on it.
void HSA_API hsa_signal_subtract_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically decrement the value of a signal by a given amount.
void HSA_API HSA_DEPRECATED hsa_signal_store_release(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_subtract_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API hsa_signal_xor_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise XOR operation between the value of a signal and a given value.
hsa_status_t HSA_API hsa_signal_group_create(uint32_t num_signals, const hsa_signal_t *signals, uint32_t num_consumers, const hsa_agent_t *consumers, hsa_signal_group_t *signal_group)
Create a signal group.
void HSA_API hsa_signal_add_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically increment the value of a signal by a given amount.
void HSA_API hsa_signal_add_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically increment the value of a signal by a given amount.
hsa_signal_value_t HSA_API hsa_signal_cas_scacquire(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
Atomically set the value of a signal if the observed value is equal to the expected value.
void HSA_API hsa_signal_silent_store_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal without necessarily notifying the the agents waiting on it.
void HSA_API HSA_DEPRECATED hsa_signal_xor_release(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API hsa_signal_wait_scacquire(hsa_signal_t signal, hsa_signal_condition_t condition, hsa_signal_value_t compare_value, uint64_t timeout_hint, hsa_wait_state_t wait_state_hint)
Wait until a signal value satisfies a specified condition, or a certain amount of time has elapsed.
hsa_signal_value_t HSA_API hsa_signal_load_scacquire(hsa_signal_t signal)
Atomically read the current value of a signal.
void HSA_API hsa_signal_and_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise AND operation between the value of a signal and a given value.
hsa_signal_value_t HSA_API hsa_signal_exchange_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal and return its previous value.
void HSA_API HSA_DEPRECATED hsa_signal_or_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
hsa_status_t HSA_API hsa_signal_group_wait_any_scacquire(hsa_signal_group_t signal_group, const hsa_signal_condition_t *conditions, const hsa_signal_value_t *compare_values, hsa_wait_state_t wait_state_hint, hsa_signal_t *signal, hsa_signal_value_t *value)
Wait until the value of at least one of the signals in a signal group satisfies its associated condit...
void HSA_API hsa_signal_and_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise AND operation between the value of a signal and a given value.
hsa_signal_condition_t
Wait condition operator.
Definition hsa.h:1931
void HSA_API HSA_DEPRECATED hsa_signal_add_release(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_subtract_acquire(hsa_signal_t signal, hsa_signal_value_t value)
hsa_wait_state_t
State of the application thread during a signal wait.
Definition hsa.h:1954
hsa_status_t HSA_API hsa_signal_group_destroy(hsa_signal_group_t signal_group)
Destroy a signal group previous created by hsa_signal_group_create.
hsa_status_t HSA_API hsa_signal_create(hsa_signal_value_t initial_value, uint32_t num_consumers, const hsa_agent_t *consumers, hsa_signal_t *signal)
Create a signal.
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_exchange_acquire(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_xor_acquire(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API hsa_signal_and_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise AND operation between the value of a signal and a given value.
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_cas_acquire(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_add_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_wait_acquire(hsa_signal_t signal, hsa_signal_condition_t condition, hsa_signal_value_t compare_value, uint64_t timeout_hint, hsa_wait_state_t wait_state_hint)
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_exchange_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
void HSA_API HSA_DEPRECATED hsa_signal_and_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
hsa_signal_value_t HSA_API hsa_signal_exchange_screlease(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal and return its previous value.
void HSA_API hsa_signal_subtract_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically decrement the value of a signal by a given amount.
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_load_acquire(hsa_signal_t signal)
hsa_signal_value_t HSA_API hsa_signal_exchange_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal and return its previous value.
void HSA_API hsa_signal_store_relaxed(hsa_signal_t signal, hsa_signal_value_t value)
Atomically set the value of a signal.
hsa_signal_value_t HSA_API HSA_DEPRECATED hsa_signal_cas_release(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
void HSA_API hsa_signal_or_scacq_screl(hsa_signal_t signal, hsa_signal_value_t value)
Atomically perform a bitwise OR operation between the value of a signal and a given value.
struct hsa_signal_group_s hsa_signal_group_t
Group of signals.
hsa_signal_value_t HSA_API hsa_signal_cas_screlease(hsa_signal_t signal, hsa_signal_value_t expected, hsa_signal_value_t value)
Atomically set the value of a signal if the observed value is equal to the expected value.
void HSA_API hsa_signal_add_scacquire(hsa_signal_t signal, hsa_signal_value_t value)
Atomically increment the value of a signal by a given amount.
void HSA_API HSA_DEPRECATED hsa_signal_xor_acq_rel(hsa_signal_t signal, hsa_signal_value_t value)
@ HSA_SIGNAL_CONDITION_NE
The two operands are not equal.
Definition hsa.h:1939
@ HSA_SIGNAL_CONDITION_EQ
The two operands are equal.
Definition hsa.h:1935
@ HSA_SIGNAL_CONDITION_LT
The first operand is less than the second operand.
Definition hsa.h:1943
@ HSA_SIGNAL_CONDITION_GTE
The first operand is greater than or equal to the second operand.
Definition hsa.h:1947
@ HSA_WAIT_STATE_ACTIVE
The application thread stays active while waiting on a signal.
Definition hsa.h:1962
@ HSA_WAIT_STATE_BLOCKED
The application thread may be rescheduled while waiting on the signal.
Definition hsa.h:1958
hsa_status_t HSA_API hsa_status_string(hsa_status_t status, const char **status_string)
Query additional information about a status code.
hsa_status_t
Status codes.
Definition hsa.h:122
@ HSA_STATUS_ERROR_INVALID_FILE
The file descriptor is invalid.
Definition hsa.h:243
@ HSA_STATUS_ERROR_INVALID_RUNTIME_STATE
The HSA runtime is not in the configuration state.
Definition hsa.h:263
@ HSA_STATUS_ERROR_INVALID_CODE_OBJECT
The code object is invalid.
Definition hsa.h:207
@ HSA_STATUS_ERROR_OUT_OF_RESOURCES
The HSA runtime failed to allocate the necessary resources.
Definition hsa.h:170
@ HSA_STATUS_ERROR_INVALID_EXECUTABLE_SYMBOL
The executable symbol is invalid.
Definition hsa.h:239
@ HSA_STATUS_ERROR_FROZEN_EXECUTABLE
The executable is frozen.
Definition hsa.h:215
@ HSA_STATUS_ERROR_NOT_INITIALIZED
An API other than hsa_init has been invoked while the reference count of the HSA runtime is 0.
Definition hsa.h:183
@ HSA_STATUS_ERROR_INVALID_AGENT
The agent is invalid.
Definition hsa.h:152
@ HSA_STATUS_ERROR_INVALID_PACKET_FORMAT
The AQL packet is malformed.
Definition hsa.h:174
@ HSA_STATUS_ERROR_INVALID_ISA_NAME
The instruction set architecture name is invalid.
Definition hsa.h:203
@ HSA_STATUS_ERROR_VARIABLE_UNDEFINED
The variable is undefined.
Definition hsa.h:227
@ HSA_STATUS_ERROR_INVALID_CODE_SYMBOL
The code object symbol is invalid.
Definition hsa.h:235
@ HSA_STATUS_ERROR
A generic error has occurred.
Definition hsa.h:135
@ HSA_STATUS_ERROR_RESOURCE_FREE
An error has been detected while releasing a resource.
Definition hsa.h:178
@ HSA_STATUS_ERROR_INVALID_ISA
The instruction set architecture is invalid.
Definition hsa.h:199
@ HSA_STATUS_ERROR_INVALID_WAVEFRONT
The wavefront is invalid.
Definition hsa.h:255
@ HSA_STATUS_ERROR_INVALID_SYMBOL_NAME
There is no symbol with the given name.
Definition hsa.h:219
@ HSA_STATUS_ERROR_INVALID_QUEUE_CREATION
The requested queue creation is not valid.
Definition hsa.h:144
@ HSA_STATUS_ERROR_INVALID_SIGNAL
The signal is invalid.
Definition hsa.h:160
@ HSA_STATUS_ERROR_INVALID_INDEX
The index is invalid.
Definition hsa.h:195
@ HSA_STATUS_INFO_BREAK
A traversal over a list of elements has been interrupted by the application before completing.
Definition hsa.h:131
@ HSA_STATUS_ERROR_INCOMPATIBLE_ARGUMENTS
The arguments passed to a functions are not compatible.
Definition hsa.h:191
@ HSA_STATUS_ERROR_INVALID_QUEUE
The queue is invalid.
Definition hsa.h:164
@ HSA_STATUS_ERROR_REFCOUNT_OVERFLOW
The maximum reference count for the object has been reached.
Definition hsa.h:187
@ HSA_STATUS_ERROR_INVALID_SIGNAL_GROUP
The signal group is invalid.
Definition hsa.h:259
@ HSA_STATUS_ERROR_INVALID_CODE_OBJECT_READER
The code object reader is invalid.
Definition hsa.h:247
@ HSA_STATUS_ERROR_VARIABLE_ALREADY_DEFINED
The variable is already defined.
Definition hsa.h:223
@ HSA_STATUS_ERROR_EXCEPTION
An HSAIL operation resulted in a hardware exception.
Definition hsa.h:231
@ HSA_STATUS_ERROR_INVALID_ARGUMENT
One of the actual arguments does not meet a precondition stated in the documentation of the correspon...
Definition hsa.h:140
@ HSA_STATUS_ERROR_INVALID_ALLOCATION
The requested allocation is not valid.
Definition hsa.h:148
@ HSA_STATUS_ERROR_INVALID_CACHE
The cache is invalid.
Definition hsa.h:251
@ HSA_STATUS_ERROR_INVALID_REGION
The memory region is invalid.
Definition hsa.h:156
@ HSA_STATUS_ERROR_INVALID_EXECUTABLE
The executable is invalid.
Definition hsa.h:211
@ HSA_STATUS_SUCCESS
The function has been executed successfully.
Definition hsa.h:126
#define HSA_DEPRECATED
Definition hsa.h:97
#define HSA_API
Definition hsa.h:71
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
Bitfield< 5, 0 > status
Bitfield< 30, 0 > index
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Agent dispatch packet.
Definition hsa.h:3013
uint32_t reserved0
Reserved.
Definition hsa.h:3028
uint64_t reserved2
Reserved.
Definition hsa.h:3054
hsa_signal_t completion_signal
Signal used to indicate completion of the job.
Definition hsa.h:3060
uint16_t type
Application-defined function to be performed by the destination agent.
Definition hsa.h:3023
uint16_t header
Packet header.
Definition hsa.h:3018
Struct containing an opaque handle to an agent, a device that participates in the HSA memory model.
Definition hsa.h:723
uint64_t handle
Opaque handle.
Definition hsa.h:728
Barrier-AND packet.
Definition hsa.h:3068
uint32_t reserved1
Reserved.
Definition hsa.h:3083
uint64_t reserved2
Reserved.
Definition hsa.h:3095
hsa_signal_t completion_signal
Signal used to indicate completion of the job.
Definition hsa.h:3101
uint16_t reserved0
Reserved.
Definition hsa.h:3078
uint16_t header
Packet header.
Definition hsa.h:3073
Barrier-OR packet.
Definition hsa.h:3109
hsa_signal_t completion_signal
Signal used to indicate completion of the job.
Definition hsa.h:3142
uint32_t reserved1
Reserved.
Definition hsa.h:3124
uint16_t reserved0
Reserved.
Definition hsa.h:3119
uint64_t reserved2
Reserved.
Definition hsa.h:3136
uint16_t header
Packet header.
Definition hsa.h:3114
Cache handle.
Definition hsa.h:1129
uint64_t handle
Opaque handle.
Definition hsa.h:1134
Application data handle that is passed to the serialization and deserialization functions.
Definition hsa.h:5152
uint64_t handle
Opaque handle.
Definition hsa.h:5156
Code object reader handle.
Definition hsa.h:4016
uint64_t handle
Opaque handle.
Definition hsa.h:4021
Struct containing an opaque handle to a code object, which contains ISA for finalized kernels and ind...
Definition hsa.h:5137
uint64_t handle
Opaque handle.
Definition hsa.h:5142
Code object symbol handle.
Definition hsa.h:5424
uint64_t handle
Opaque handle.
Definition hsa.h:5429
Three-dimensional coordinate.
Definition hsa.h:297
uint32_t x
X dimension.
Definition hsa.h:301
uint32_t z
Z dimension.
Definition hsa.h:311
uint32_t y
Y dimension.
Definition hsa.h:306
Struct containing an opaque handle to an executable, which contains ISA for finalized kernels and ind...
Definition hsa.h:4108
uint64_t handle
Opaque handle.
Definition hsa.h:4113
Executable symbol handle.
Definition hsa.h:4654
uint64_t handle
Opaque handle.
Definition hsa.h:4659
Instruction set architecture.
Definition hsa.h:3529
uint64_t handle
Opaque handle.
Definition hsa.h:3534
AQL kernel dispatch packet.
Definition hsa.h:2901
uint64_t reserved2
Reserved.
Definition hsa.h:2999
uint16_t header
Packet header.
Definition hsa.h:2906
uint32_t grid_size_z
Z dimension of grid, in work-items.
Definition hsa.h:2955
uint32_t group_segment_size
Size in bytes of group memory allocation request (per work-group).
Definition hsa.h:2968
uint16_t reserved0
Reserved.
Definition hsa.h:2935
uint64_t kernel_object
Opaque handle to a code object that includes an implementation-defined executable code for the kernel...
Definition hsa.h:2974
hsa_signal_t completion_signal
Signal used to indicate completion of the job.
Definition hsa.h:3005
uint16_t workgroup_size_y
Y dimension of work-group, in work-items.
Definition hsa.h:2924
uint16_t setup
Dispatch setup parameters.
Definition hsa.h:2913
uint32_t grid_size_x
X dimension of grid, in work-items.
Definition hsa.h:2941
uint16_t workgroup_size_z
Z dimension of work-group, in work-items.
Definition hsa.h:2930
uint16_t workgroup_size_x
X dimension of work-group, in work-items.
Definition hsa.h:2918
uint32_t private_segment_size
Size in bytes of private memory allocation request (per work-item).
Definition hsa.h:2960
uint32_t grid_size_y
Y dimension of grid, in work-items.
Definition hsa.h:2948
Loaded code object handle.
Definition hsa.h:4240
uint64_t handle
Opaque handle.
Definition hsa.h:4245
User mode queue.
Definition hsa.h:2243
uint32_t size
Maximum number of packets the queue can hold.
Definition hsa.h:2288
hsa_queue_type32_t type
Queue type.
Definition hsa.h:2247
uint64_t id
Queue identifier, which is unique over the lifetime of the application.
Definition hsa.h:2296
void * base_address
Definition hsa.h:2269
uint32_t reserved1
Reserved.
Definition hsa.h:2292
uint32_t reserved0
Definition hsa.h:2268
uint32_t features
Queue features mask.
Definition hsa.h:2253
hsa_signal_t doorbell_signal
Signal object used by the application to indicate the ID of a packet that is ready to be processed.
Definition hsa.h:2283
A memory region represents a block of virtual memory with certain properties.
Definition hsa.h:2179
uint64_t handle
Opaque handle.
Definition hsa.h:2184
Group of signals.
Definition hsa.h:2038
uint64_t handle
Opaque handle.
Definition hsa.h:2043
Signal handle.
Definition hsa.h:1307
uint64_t handle
Opaque handle.
Definition hsa.h:1312
Wavefront handle.
Definition hsa.h:3895
uint64_t handle
Opaque handle.
Definition hsa.h:3900
const std::string & name()
Definition trace.cc:48

Generated on Tue Jun 18 2024 16:24:03 for gem5 by doxygen 1.11.0