Skip to content

Commit

Permalink
Minor fixes to opencl from testing on apple
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Oct 21, 2024
1 parent fc47c23 commit 2a108b7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
17 changes: 17 additions & 0 deletions src/apex/apex_opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,24 @@
* limitations under the License.
******************************************************************************/

#ifdef __APPLE__
#include <OpenCL/opencl.h>
#ifndef CL_API_PREFIX__VERSION_1_1_DEPRECATED
#define CL_API_PREFIX__VERSION_1_1_DEPRECATED
#endif
#ifndef CL_API_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_API_SUFFIX__VERSION_1_1_DEPRECATED
#endif
#ifndef CL_API_PREFIX__VERSION_1_2_DEPRECATED
#define CL_API_PREFIX__VERSION_1_2_DEPRECATED
#endif
#ifndef CL_API_SUFFIX__VERSION_1_2_DEPRECATED
#define CL_API_SUFFIX__VERSION_1_2_DEPRECATED
#endif
#else
#include <CL/cl.h>
#endif

#include <type_traits>
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
Expand Down
2 changes: 1 addition & 1 deletion src/apex/apex_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ typedef enum _profile_type {
*/
typedef enum _argument_type {
APEX_LONG_INTEGER_TYPE = 0,
APEX_UNSIGNED_LONG_INTEGER_TYPE = 0,
APEX_UNSIGNED_LONG_INTEGER_TYPE,
APEX_DOUBLE_TYPE,
APEX_STRING_TYPE,
APEX_POINTER_TYPE,
Expand Down
6 changes: 5 additions & 1 deletion src/apex/trace_event_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,12 @@ inline void trace_event_listener::_common_stop(std::shared_ptr<profiler> &p) {
for (size_t a = 0 ; a < p->tt_ptr->arguments.size() ; a++) {
auto& arg = p->tt_ptr->arguments[a];
switch (p->tt_ptr->argument_types[a]) {
case APEX_UNSIGNED_LONG_INTEGER_TYPE: {
ss << ",\"" << p->tt_ptr->argument_names[a] << "\":\"" << std::get<uint64_t>(arg) << "\"";
break;
}
case APEX_LONG_INTEGER_TYPE: {
ss << ",\"" << p->tt_ptr->argument_names[a] << "\":\"" << std::get<long>(arg) << "\"";
ss << ",\"" << p->tt_ptr->argument_names[a] << "\":\"" << std::get<int64_t>(arg) << "\"";
break;
}
case APEX_DOUBLE_TYPE: {
Expand Down

0 comments on commit 2a108b7

Please sign in to comment.