File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -76,13 +76,12 @@ __dpctl_give DPCTLSyclPlatformRef DPCTLPlatform_Create()
76
76
__dpctl_give DPCTLSyclPlatformRef DPCTLPlatform_CreateFromSelector (
77
77
__dpctl_keep const DPCTLSyclDeviceSelectorRef DSRef)
78
78
{
79
- DPCTLSyclPlatformRef PRef = nullptr ;
80
- auto DS = unwrap (DSRef);
81
- if (DS) {
79
+ if (DSRef) {
80
+ auto DS = unwrap (DSRef);
82
81
platform *P = nullptr ;
83
82
try {
84
83
P = new platform (*DS);
85
- PRef = wrap (P);
84
+ return wrap (P);
86
85
} catch (std::bad_alloc const &ba) {
87
86
std::cerr << ba.what () << ' \n ' ;
88
87
return nullptr ;
@@ -96,7 +95,7 @@ __dpctl_give DPCTLSyclPlatformRef DPCTLPlatform_CreateFromSelector(
96
95
std::cerr << " Device selector pointer cannot be NULL\n " ;
97
96
}
98
97
99
- return PRef ;
98
+ return nullptr ;
100
99
}
101
100
102
101
void DPCTLPlatform_Delete (__dpctl_take DPCTLSyclPlatformRef PRef)
You can’t perform that action at this time.
0 commit comments