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 13
13
#include " common.hpp"
14
14
#include " program.hpp"
15
15
#include < cstdint>
16
+ #include < memory>
16
17
17
18
UR_APIEXPORT ur_result_t UR_APICALL
18
19
urProgramCreateWithIL (ur_context_handle_t hContext, const void *pIL,
@@ -72,11 +73,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithBinary(
72
73
UR_ASSERT (phProgram, UR_RESULT_ERROR_INVALID_NULL_POINTER);
73
74
UR_ASSERT (pBinary != nullptr , UR_RESULT_ERROR_INVALID_NULL_POINTER);
74
75
75
- auto hProgram = new ur_program_handle_t_ (
76
+ auto hProgram = std::make_unique< ur_program_handle_t_> (
76
77
hContext, reinterpret_cast <const unsigned char *>(pBinary));
77
78
if (pProperties != nullptr ) {
78
79
for (uint32_t i = 0 ; i < pProperties->count ; i++) {
79
- auto mdNode = pProperties->pMetadatas [i];
80
+ const auto & mdNode = pProperties->pMetadatas [i];
80
81
std::string mdName (mdNode.pName );
81
82
auto [Prefix, Tag] = splitMetadataName (mdName);
82
83
if (Tag == __SYCL_UR_PROGRAM_METADATA_TAG_REQD_WORK_GROUP_SIZE) {
@@ -98,7 +99,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithBinary(
98
99
nativecpu_it++;
99
100
}
100
101
101
- *phProgram = hProgram;
102
+ *phProgram = hProgram. release () ;
102
103
103
104
return UR_RESULT_SUCCESS;
104
105
}
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