1 bovenliggende
d919e2223d
commit
4ef95f4e73
7 files changed
+15
-18
No files matched your search
@@ -80,8 +80,8 @@ int main() {
|
|||||||
|
|
||||||
hipFree(Ad);
|
hipFree(Ad);
|
||||||
hipFree(Bd);
|
hipFree(Bd);
|
||||||
delete A;
|
delete[] A;
|
||||||
delete B;
|
delete[] B;
|
||||||
hipCtxDestroy(context);
|
hipCtxDestroy(context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -107,8 +107,8 @@ int main() {
|
|||||||
|
|
||||||
hipFree(Ad);
|
hipFree(Ad);
|
||||||
hipFree(Bd);
|
hipFree(Bd);
|
||||||
delete A;
|
delete[] A;
|
||||||
delete B;
|
delete[] B;
|
||||||
hipCtxDestroy(context);
|
hipCtxDestroy(context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -99,8 +99,8 @@ int main() {
|
|||||||
|
|
||||||
hipFree(Ad);
|
hipFree(Ad);
|
||||||
hipFree(Bd);
|
hipFree(Bd);
|
||||||
delete A;
|
delete[] A;
|
||||||
delete B;
|
delete[] B;
|
||||||
hipCtxDestroy(context);
|
hipCtxDestroy(context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -154,8 +154,8 @@ int main() {
|
|||||||
|
|
||||||
hipFree(Ad);
|
hipFree(Ad);
|
||||||
hipFree(Bd);
|
hipFree(Bd);
|
||||||
delete A;
|
delete[] A;
|
||||||
delete B;
|
delete[] B;
|
||||||
hipCtxDestroy(context);
|
hipCtxDestroy(context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -330,22 +330,18 @@ hipError_t ihipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList
|
|||||||
return hipErrorInvalidValue;
|
return hipErrorInvalidValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
hipFunction_t* kds = reinterpret_cast<hipFunction_t*>(malloc(sizeof(hipFunction_t) * numDevices));
|
std::vector<hipFunction_t> kds(numDevices,0);
|
||||||
if (kds == nullptr) {
|
|
||||||
return hipErrorNotInitialized;
|
|
||||||
}
|
|
||||||
|
|
||||||
// prepare all kernel descriptors for each device as all streams will be locked in the next loop
|
// prepare all kernel descriptors for each device as all streams will be locked in the next loop
|
||||||
for (int i = 0; i < numDevices; ++i) {
|
for (int i = 0; i < numDevices; ++i) {
|
||||||
const hipLaunchParams& lp = launchParamsList[i];
|
const hipLaunchParams& lp = launchParamsList[i];
|
||||||
if (lp.stream == nullptr) {
|
if (lp.stream == nullptr) {
|
||||||
free(kds);
|
|
||||||
return hipErrorNotInitialized;
|
return hipErrorNotInitialized;
|
||||||
}
|
}
|
||||||
kds[i] = ps.kernel_descriptor(reinterpret_cast<std::uintptr_t>(lp.func),
|
kds[i] = ps.kernel_descriptor(reinterpret_cast<std::uintptr_t>(lp.func),
|
||||||
hip_impl::target_agent(lp.stream));
|
hip_impl::target_agent(lp.stream));
|
||||||
|
|
||||||
if (kds[i] == nullptr) {
|
if (kds[i] == nullptr) {
|
||||||
free(kds);
|
|
||||||
return hipErrorInvalidValue;
|
return hipErrorInvalidValue;
|
||||||
}
|
}
|
||||||
hip_impl::kernargs_size_align kargs = ps.get_kernargs_size_align(
|
hip_impl::kernargs_size_align kargs = ps.get_kernargs_size_align(
|
||||||
@@ -398,8 +394,6 @@ hipError_t ihipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
free(kds);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -312,6 +312,7 @@ hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResou
|
|||||||
HSA_EXT_IMAGE_DATA_LAYOUT_LINEAR, pitch, 0, &(pTexture->image)) ||
|
HSA_EXT_IMAGE_DATA_LAYOUT_LINEAR, pitch, 0, &(pTexture->image)) ||
|
||||||
HSA_STATUS_SUCCESS !=
|
HSA_STATUS_SUCCESS !=
|
||||||
hsa_ext_sampler_create(*agent, &samplerDescriptor, &(pTexture->sampler))) {
|
hsa_ext_sampler_create(*agent, &samplerDescriptor, &(pTexture->sampler))) {
|
||||||
|
free(pTexture);
|
||||||
return ihipLogStatus(hipErrorRuntimeOther);
|
return ihipLogStatus(hipErrorRuntimeOther);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,6 +450,7 @@ hipError_t ihipBindTextureImpl(TlsData *tls_, int dim, enum hipTextureReadMode r
|
|||||||
HSA_EXT_IMAGE_DATA_LAYOUT_LINEAR, rowPitch, 0, &(pTexture->image)) ||
|
HSA_EXT_IMAGE_DATA_LAYOUT_LINEAR, rowPitch, 0, &(pTexture->image)) ||
|
||||||
HSA_STATUS_SUCCESS !=
|
HSA_STATUS_SUCCESS !=
|
||||||
hsa_ext_sampler_create(*agent, &samplerDescriptor, &(pTexture->sampler))) {
|
hsa_ext_sampler_create(*agent, &samplerDescriptor, &(pTexture->sampler))) {
|
||||||
|
free(pTexture);
|
||||||
return hipErrorRuntimeOther;
|
return hipErrorRuntimeOther;
|
||||||
}
|
}
|
||||||
getHipTextureObject(&textureObject, pTexture->image, pTexture->sampler);
|
getHipTextureObject(&textureObject, pTexture->image, pTexture->sampler);
|
||||||
@@ -525,6 +527,7 @@ hipError_t ihipBindTexture2DImpl(TlsData *tls, int dim, enum hipTextureReadMode
|
|||||||
HSA_EXT_IMAGE_DATA_LAYOUT_LINEAR, pitch, 0, &(pTexture->image)) ||
|
HSA_EXT_IMAGE_DATA_LAYOUT_LINEAR, pitch, 0, &(pTexture->image)) ||
|
||||||
HSA_STATUS_SUCCESS !=
|
HSA_STATUS_SUCCESS !=
|
||||||
hsa_ext_sampler_create(*agent, &samplerDescriptor, &(pTexture->sampler))) {
|
hsa_ext_sampler_create(*agent, &samplerDescriptor, &(pTexture->sampler))) {
|
||||||
|
free(pTexture);
|
||||||
return hipErrorRuntimeOther;
|
return hipErrorRuntimeOther;
|
||||||
}
|
}
|
||||||
getHipTextureObject(&textureObject, pTexture->image, pTexture->sampler);
|
getHipTextureObject(&textureObject, pTexture->image, pTexture->sampler);
|
||||||
|
|||||||
+2
-2
@@ -107,8 +107,8 @@ void run(const std::vector<char>& buffer) {
|
|||||||
|
|
||||||
hipFree(Ad);
|
hipFree(Ad);
|
||||||
hipFree(Bd);
|
hipFree(Bd);
|
||||||
delete A;
|
delete[] A;
|
||||||
delete B;
|
delete[] B;
|
||||||
hipCtxDestroy(context);
|
hipCtxDestroy(context);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user