File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
source/adapters/native_cpu Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 14
14
#include " common/ur_util.hpp"
15
15
#include " program.hpp"
16
16
#include < cstdint>
17
+ #include < memory>
17
18
18
19
UR_APIEXPORT ur_result_t UR_APICALL
19
20
urProgramCreateWithIL (ur_context_handle_t hContext, const void *pIL,
@@ -63,11 +64,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithBinary(
63
64
UR_ASSERT (phProgram, UR_RESULT_ERROR_INVALID_NULL_POINTER);
64
65
UR_ASSERT (pBinary != nullptr , UR_RESULT_ERROR_INVALID_NULL_POINTER);
65
66
66
- auto hProgram = new ur_program_handle_t_ (
67
+ auto hProgram = std::make_unique< ur_program_handle_t_> (
67
68
hContext, reinterpret_cast <const unsigned char *>(pBinary));
68
69
if (pProperties != nullptr ) {
69
70
for (uint32_t i = 0 ; i < pProperties->count ; i++) {
70
- auto mdNode = pProperties->pMetadatas [i];
71
+ const auto & mdNode = pProperties->pMetadatas [i];
71
72
std::string mdName (mdNode.pName );
72
73
auto [Prefix, Tag] = splitMetadataName (mdName);
73
74
if (Tag == __SYCL_UR_PROGRAM_METADATA_TAG_REQD_WORK_GROUP_SIZE) {
@@ -89,7 +90,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithBinary(
89
90
nativecpu_it++;
90
91
}
91
92
92
- *phProgram = hProgram;
93
+ *phProgram = hProgram. release () ;
93
94
94
95
return UR_RESULT_SUCCESS;
95
96
}
Original file line number Diff line number Diff line change 13
13
#include < ur_api.h>
14
14
15
15
#include " context.hpp"
16
+
17
+ #include < array>
16
18
#include < map>
17
19
18
20
namespace native_cpu {
You can’t perform that action at this time.
0 commit comments