Skip to content

Commit 0004013

Browse files
committed
Change prefix from offload to ol
1 parent 9786c2d commit 0004013

40 files changed

+1153
-1214
lines changed

offload/new-api/API/APIDefs.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// Prefix for API naming. This could be hard-coded in the future when a value
1616
// is agreed upon.
17-
defvar PREFIX = "OFFLOAD";
17+
defvar PREFIX = "OL";
1818
defvar prefix = !tolower(PREFIX);
1919

2020
// Parameter flags

offload/new-api/API/Common.td

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
11
def : Macro {
2-
let name = "OFFLOAD_VERSION_MAJOR";
2+
let name = "OL_VERSION_MAJOR";
33
let desc = "Major version of the Offload API";
44
let value = "0";
55
}
66

77
def : Macro {
8-
let name = "OFFLOAD_VERSION_MINOR";
8+
let name = "OL_VERSION_MINOR";
99
let desc = "Minor version of the Offload API";
1010
let value = "0";
1111
}
1212

1313
def : Macro {
14-
let name = "OFFLOAD_VERSION_PATCH";
14+
let name = "OL_VERSION_PATCH";
1515
let desc = "Patch version of the Offload API";
1616
let value = "1";
1717
}
1818

1919
def : Macro {
20-
let name = "OFFLOAD_APICALL";
20+
let name = "OL_APICALL";
2121
let desc = "Calling convention for all API functions";
2222
let condition = "defined(_WIN32)";
2323
let value = "__cdecl";
2424
let alt_value = "";
2525
}
2626

2727
def : Macro {
28-
let name = "OFFLOAD_APIEXPORT";
28+
let name = "OL_APIEXPORT";
2929
let desc = "Microsoft-specific dllexport storage-class attribute";
3030
let condition = "defined(_WIN32)";
3131
let value = "__declspec(dllexport)";
3232
let alt_value = "";
3333
}
3434

3535
def : Macro {
36-
let name = "OFFLOAD_DLLEXPORT";
36+
let name = "OL_DLLEXPORT";
3737
let desc = "Microsoft-specific dllexport storage-class attribute";
3838
let condition = "defined(_WIN32)";
3939
let value = "__declspec(dllexport)";
4040
}
4141

4242
def : Macro {
43-
let name = "OFFLOAD_DLLEXPORT";
43+
let name = "OL_DLLEXPORT";
4444
let desc = "GCC-specific dllexport storage-class attribute";
4545
let condition = "__GNUC__ >= 4";
4646
let value = "__attribute__ ((visibility (\"default\")))";
4747
let alt_value = "";
4848
}
4949

5050
def : Handle {
51-
let name = "offload_platform_handle_t";
51+
let name = "ol_platform_handle_t";
5252
let desc = "Handle of a platform instance";
5353
}
5454

5555
def : Handle {
56-
let name = "offload_device_handle_t";
56+
let name = "ol_device_handle_t";
5757
let desc = "Handle of platform's device object";
5858
}
5959

6060
def : Handle {
61-
let name = "offload_context_handle_t";
61+
let name = "ol_context_handle_t";
6262
let desc = "Handle of context object";
6363
}
6464

6565
def : Enum {
66-
let name = "offload_errc_t";
66+
let name = "ol_errc_t";
6767
let desc = "Defines Return/Error codes";
6868
let etors =[
6969
Etor<"SUCCESS", "Success">,
@@ -87,28 +87,28 @@ def : Enum {
8787
}
8888

8989
def : Struct {
90-
let name = "offload_error_struct_t";
90+
let name = "ol_error_struct_t";
9191
let desc = "Details of the error condition returned by an API call";
9292
let members = [
93-
StructMember<"offload_errc_t", "Code", "The error code">,
93+
StructMember<"ol_errc_t", "Code", "The error code">,
9494
StructMember<"const char*", "Details", "String containing error details">
9595
];
9696
}
9797

9898
def : Typedef {
99-
let name = "offload_result_t";
99+
let name = "ol_result_t";
100100
let desc = "Result type returned by all entry points.";
101-
let value = "const offload_error_struct_t*";
101+
let value = "const ol_error_struct_t*";
102102
}
103103

104104
def : Macro {
105-
let name = "OFFLOAD_RESULT_SUCCESS";
105+
let name = "OL_SUCCESS";
106106
let desc = "Success condition";
107107
let value = "NULL";
108108
}
109109

110110
def : Struct {
111-
let name = "offload_code_location_t";
111+
let name = "ol_code_location_t";
112112
let desc = "Code location information that can optionally be associated with an API call";
113113
let members = [
114114
StructMember<"const char*", "FunctionName", "Function name">,
@@ -119,18 +119,18 @@ def : Struct {
119119
}
120120

121121
def : Function {
122-
let name = "offloadInit";
122+
let name = "olInit";
123123
let desc = "Perform initialization of the Offload library and plugins";
124124
let details = [
125125
"This must be the first API call made by a user of the Offload library",
126-
"Each call will increment an internal reference count that is decremented by `offloadShutDown`"
126+
"Each call will increment an internal reference count that is decremented by `olShutDown`"
127127
];
128128
let params = [];
129129
let returns = [];
130130
}
131131

132132
def : Function {
133-
let name = "offloadShutDown";
133+
let name = "olShutDown";
134134
let desc = "Release the resources in use by Offload";
135135
let details = [
136136
"This decrements an internal reference count. When this reaches 0, all resources will be released",

offload/new-api/API/Device.td

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
def : Enum {
14-
let name = "offload_device_type_t";
14+
let name = "ol_device_type_t";
1515
let desc = "Supported device types";
1616
let etors =[
1717
Etor<"DEFAULT", "The default device type as preferred by the runtime">,
@@ -22,85 +22,85 @@ def : Enum {
2222
}
2323

2424
def : Enum {
25-
let name = "offload_device_info_t";
25+
let name = "ol_device_info_t";
2626
let desc = "Supported device info";
2727
let is_typed = 1;
2828
let etors =[
29-
TaggedEtor<"TYPE", "offload_device_type_t", "type of the device">,
30-
TaggedEtor<"PLATFORM", "offload_platform_handle_t", "the platform associated with the device">,
29+
TaggedEtor<"TYPE", "ol_device_type_t", "type of the device">,
30+
TaggedEtor<"PLATFORM", "ol_platform_handle_t", "the platform associated with the device">,
3131
TaggedEtor<"NAME", "char[]", "Device name">,
3232
TaggedEtor<"VENDOR", "char[]", "Device vendor">,
3333
TaggedEtor<"DRIVER_VERSION", "char[]", "Driver version">
3434
];
3535
}
3636

3737
def : Function {
38-
let name = "offloadDeviceGetCount";
38+
let name = "olGetDeviceCount";
3939
let desc = "Retrieves the number of available devices within a platform";
4040
let params = [
41-
Param<"offload_platform_handle_t", "Platform", "handle of the platform instance", PARAM_IN>,
41+
Param<"ol_platform_handle_t", "Platform", "handle of the platform instance", PARAM_IN>,
4242
Param<"uint32_t*", "NumDevices", "pointer to the number of devices.", PARAM_OUT>
4343
];
4444
let returns = [];
4545
}
4646

4747
def : Function {
48-
let name = "offloadDeviceGet";
48+
let name = "olGetDevice";
4949
let desc = "Retrieves devices within a platform";
5050
let details = [
5151
"Multiple calls to this function will return identical device handles, in the same order.",
5252
];
5353
let params = [
54-
Param<"offload_platform_handle_t", "Platform", "handle of the platform instance", PARAM_IN>,
54+
Param<"ol_platform_handle_t", "Platform", "handle of the platform instance", PARAM_IN>,
5555
Param<"uint32_t", "NumEntries", "the number of devices to be added to phDevices, which must be greater than zero", PARAM_IN>,
56-
RangedParam<"offload_device_handle_t*", "Devices", "Array of device handles. "
56+
RangedParam<"ol_device_handle_t*", "Devices", "Array of device handles. "
5757
"If NumEntries is less than the number of devices available, then this function shall only retrieve that number of devices.", PARAM_OUT,
5858
Range<"0", "NumEntries">>
5959
];
6060
let returns = [
61-
Return<"OFFLOAD_ERRC_INVALID_SIZE", [
61+
Return<"OL_ERRC_INVALID_SIZE", [
6262
"`NumEntries == 0`"
6363
]>
6464
];
6565
}
6666

6767
def : Function {
68-
let name = "offloadDeviceGetInfo";
68+
let name = "olGetDeviceInfo";
6969
let desc = "Queries the given property of the device";
7070
let details = [];
7171
let params = [
72-
Param<"offload_device_handle_t", "Device", "handle of the device instance", PARAM_IN>,
73-
Param<"offload_device_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,
72+
Param<"ol_device_handle_t", "Device", "handle of the device instance", PARAM_IN>,
73+
Param<"ol_device_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,
7474
Param<"size_t", "PropSize", "the number of bytes pointed to by PropValue.", PARAM_IN>,
7575
TypeTaggedParam<"void*", "PropValue", "array of bytes holding the info. If PropSize is not equal to or greater than the real "
76-
"number of bytes needed to return the info then the OFFLOAD_ERRC_INVALID_SIZE error is returned and "
76+
"number of bytes needed to return the info then the OL_ERRC_INVALID_SIZE error is returned and "
7777
"PropValue is not used.", PARAM_OUT, TypeInfo<"PropName" , "PropSize">>
7878
];
7979
let returns = [
80-
Return<"OFFLOAD_ERRC_UNSUPPORTED_ENUMERATION", [
80+
Return<"OL_ERRC_UNSUPPORTED_ENUMERATION", [
8181
"If `PropName` is not supported by the device."
8282
]>,
83-
Return<"OFFLOAD_ERRC_INVALID_SIZE", [
83+
Return<"OL_ERRC_INVALID_SIZE", [
8484
"`PropSize == 0`",
8585
"If `PropSize` is less than the real number of bytes needed to return the info."
8686
]>,
87-
Return<"OFFLOAD_ERRC_INVALID_DEVICE">
87+
Return<"OL_ERRC_INVALID_DEVICE">
8888
];
8989
}
9090

9191
def : Function {
92-
let name = "offloadDeviceGetInfoSize";
92+
let name = "olGetDeviceInfoSize";
9393
let desc = "Returns the storage size of the given device query";
9494
let details = [];
9595
let params = [
96-
Param<"offload_device_handle_t", "Device", "handle of the device instance", PARAM_IN>,
97-
Param<"offload_device_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,
96+
Param<"ol_device_handle_t", "Device", "handle of the device instance", PARAM_IN>,
97+
Param<"ol_device_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,
9898
Param<"size_t*", "PropSizeRet", "pointer to the number of bytes required to store the query", PARAM_OUT>
9999
];
100100
let returns = [
101-
Return<"OFFLOAD_ERRC_UNSUPPORTED_ENUMERATION", [
101+
Return<"OL_ERRC_UNSUPPORTED_ENUMERATION", [
102102
"If `PropName` is not supported by the device."
103103
]>,
104-
Return<"OFFLOAD_ERRC_INVALID_DEVICE">
104+
Return<"OL_ERRC_INVALID_DEVICE">
105105
];
106106
}

offload/new-api/API/Platform.td

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
def : Function {
13-
let name = "offloadPlatformGet";
13+
let name = "olGetPlatform";
1414
let desc = "Retrieves all available platforms";
1515
let details = [
1616
"Multiple calls to this function will return identical platforms handles, in the same order.",
@@ -20,21 +20,21 @@ def : Function {
2020
"The number of platforms to be added to Platforms. NumEntries must be "
2121
"greater than zero.",
2222
PARAM_IN>,
23-
RangedParam<"offload_platform_handle_t*", "Platforms",
23+
RangedParam<"ol_platform_handle_t*", "Platforms",
2424
"Array of handle of platforms. If NumEntries is less than the number of "
25-
"platforms available, then offloadPlatformGet shall only retrieve that "
25+
"platforms available, then olGetPlatform shall only retrieve that "
2626
"number of platforms.",
2727
PARAM_OUT, Range<"0", "NumEntries">>
2828
];
2929
let returns = [
30-
Return<"OFFLOAD_ERRC_INVALID_SIZE", [
30+
Return<"OL_ERRC_INVALID_SIZE", [
3131
"`NumEntries == 0`"
3232
]>
3333
];
3434
}
3535

3636
def : Function {
37-
let name = "offloadPlatformGetCount";
37+
let name = "olGetPlatformCount";
3838
let desc = "Retrieves the number of available platforms";
3939
let params = [
4040
Param<"uint32_t*",
@@ -45,19 +45,19 @@ def : Function {
4545
}
4646

4747
def : Enum {
48-
let name = "offload_platform_info_t";
48+
let name = "ol_platform_info_t";
4949
let desc = "Supported platform info";
5050
let is_typed = 1;
5151
let etors = [
5252
TaggedEtor<"NAME", "char[]", "The string denoting name of the platform. The size of the info needs to be dynamically queried.">,
5353
TaggedEtor<"VENDOR_NAME", "char[]", "The string denoting name of the vendor of the platform. The size of the info needs to be dynamically queried.">,
5454
TaggedEtor<"VERSION", "char[]", "The string denoting the version of the platform. The size of the info needs to be dynamically queried.">,
55-
TaggedEtor<"BACKEND", "offload_platform_backend_t", "The native backend of the platform.">
55+
TaggedEtor<"BACKEND", "ol_platform_backend_t", "The native backend of the platform.">
5656
];
5757
}
5858

5959
def : Enum {
60-
let name = "offload_platform_backend_t";
60+
let name = "ol_platform_backend_t";
6161
let desc = "Identifies the native backend of the platform";
6262
let etors =[
6363
Etor<"UNKNOWN", "The backend is not recognized">,
@@ -67,46 +67,46 @@ def : Enum {
6767
}
6868

6969
def : Function {
70-
let name = "offloadPlatformGetInfo";
70+
let name = "olGetPlatformInfo";
7171
let desc = "Queries the given property of the platform";
7272
let details = [
73-
"`offloadPlatformGetInfoSize` can be used to query the storage size "
73+
"`olGetPlatformInfoSize` can be used to query the storage size "
7474
"required for the given query."
7575
];
7676
let params = [
77-
Param<"offload_platform_handle_t", "Platform", "handle of the platform", PARAM_IN>,
78-
Param<"offload_platform_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,
77+
Param<"ol_platform_handle_t", "Platform", "handle of the platform", PARAM_IN>,
78+
Param<"ol_platform_info_t", "PropName", "type of the info to retrieve", PARAM_IN>,
7979
Param<"size_t", "PropSize", "the number of bytes pointed to by pPlatformInfo.", PARAM_IN>,
8080
TypeTaggedParam<"void*", "PropValue", "array of bytes holding the info. "
8181
"If Size is not equal to or greater to the real number of bytes needed to return the info "
82-
"then the OFFLOAD_ERRC_INVALID_SIZE error is returned and pPlatformInfo is not used.", PARAM_OUT,
82+
"then the OL_ERRC_INVALID_SIZE error is returned and pPlatformInfo is not used.", PARAM_OUT,
8383
TypeInfo<"PropName" , "PropSize">>
8484
];
8585
let returns = [
86-
Return<"OFFLOAD_ERRC_UNSUPPORTED_ENUMERATION", [
86+
Return<"OL_ERRC_UNSUPPORTED_ENUMERATION", [
8787
"If `PropName` is not supported by the platform."
8888
]>,
89-
Return<"OFFLOAD_ERRC_INVALID_SIZE", [
89+
Return<"OL_ERRC_INVALID_SIZE", [
9090
"`PropSize == 0`",
9191
"If `PropSize` is less than the real number of bytes needed to return the info."
9292
]>,
93-
Return<"OFFLOAD_ERRC_INVALID_PLATFORM">
93+
Return<"OL_ERRC_INVALID_PLATFORM">
9494
];
9595
}
9696

9797
def : Function {
98-
let name = "offloadPlatformGetInfoSize";
98+
let name = "olGetPlatformInfoSize";
9999
let desc = "Returns the storage size of the given platform query";
100100
let details = [];
101101
let params = [
102-
Param<"offload_platform_handle_t", "Platform", "handle of the platform", PARAM_IN>,
103-
Param<"offload_platform_info_t", "PropName", "type of the info to query", PARAM_IN>,
102+
Param<"ol_platform_handle_t", "Platform", "handle of the platform", PARAM_IN>,
103+
Param<"ol_platform_info_t", "PropName", "type of the info to query", PARAM_IN>,
104104
Param<"size_t*", "PropSizeRet", "pointer to the number of bytes required to store the query", PARAM_OUT>
105105
];
106106
let returns = [
107-
Return<"OFFLOAD_ERRC_UNSUPPORTED_ENUMERATION", [
107+
Return<"OL_ERRC_UNSUPPORTED_ENUMERATION", [
108108
"If `PropName` is not supported by the platform."
109109
]>,
110-
Return<"OFFLOAD_ERRC_INVALID_PLATFORM">
110+
Return<"OL_ERRC_INVALID_PLATFORM">
111111
];
112112
}

offload/new-api/API/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ plugin-specific implementation details.
3131

3232
There are two special variants of a *parameter*:
3333
* **RangedParameter** - Represents a parameter that has a range described by other parameters. Generally these are pointers to an arbitrary number of objects. The range is used for generating validation and printing code. E.g, a range might be between `(0, NumDevices)`
34-
* **TypeTaggedParameter** - Represents a parameter (usually of `void*` type) that has the type and size of its pointee data described by other function parameters. The type is usually described by a type-tagged enum. This allows functions (e.g. `offloadDeviceGetInfo`) to return data of an arbitrary type.
34+
* **TypeTaggedParameter** - Represents a parameter (usually of `void*` type) that has the type and size of its pointee data described by other function parameters. The type is usually described by a type-tagged enum. This allows functions (e.g. `olGetDeviceInfo`) to return data of an arbitrary type.
3535

3636
#### Return
3737
A return represents a possible return code from the function, and optionally a
@@ -64,7 +64,7 @@ and description.
6464

6565
A `TaggedEtor` record type also exists which addtionally takes a type. This type
6666
is used when the enum is used as a parameter to a function with a type-tagged
67-
function parameter (e.g. `offloadDeviceGetInfo`).
67+
function parameter (e.g. `olGetDeviceInfo`).
6868

6969
All enums automatically get a `<enum_name>_FORCE_UINT32 = 0x7fffffff` value,
7070
which forces the underlying type to be uint32.

0 commit comments

Comments
 (0)