P4 to Git Change 1582337 by vsytchen@vsytchen-win10 on 2018/07/18 15:21:49

SWDEV-79445 - OCL generic changes and code clean-up

	1. std::bind2nd is deprecated in c++11 and removed in c++17. Use a range based for loop without any functor instead.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/15430/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#59 edit
This commit is contained in:
foreman
2018-07-18 15:41:11 -04:00
parent 8c09d51ced
commit 7899017d49
+11 -11
View File
@@ -688,13 +688,6 @@ void VirtualGPU::profilingEnd(amd::Command& command) {
}
}
struct DestroySampler : public std::binary_function<hsa_ext_sampler_t, hsa_agent_t, bool> {
bool operator()(hsa_ext_sampler_t& sampler, hsa_agent_t agent) const {
hsa_status_t status = hsa_ext_sampler_destroy(agent, sampler);
return status == HSA_STATUS_SUCCESS;
}
};
void VirtualGPU::updateCommandsState(amd::Command* list) {
Timestamp* ts = nullptr;
@@ -774,8 +767,11 @@ void VirtualGPU::updateCommandsState(amd::Command* list) {
// Release the sampler handles allocated for the various
// on one or more kernel submissions
std::for_each(samplerList_.begin(), samplerList_.end(),
std::bind2nd<DestroySampler>(DestroySampler(), gpu_device_));
for (const auto& it: samplerList_) {
if (hsa_ext_sampler_destroy(gpu_device_, it) != HSA_STATUS_SUCCESS) {
LogWarning("Error destroying device sampler object!");
}
}
samplerList_.clear();
return;
@@ -2046,9 +2042,13 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
releaseGpuMemoryFence();
// Release the sampler handles allocated for the various
// on one or more kernel submissions
std::for_each(samplerList_.begin(), samplerList_.end(),
std::bind2nd<DestroySampler>(DestroySampler(), gpu_device_));
for (const auto& it: samplerList_) {
if (hsa_ext_sampler_destroy(gpu_device_, it) != HSA_STATUS_SUCCESS) {
LogWarning("Error destroying device sampler object!");
}
}
samplerList_.clear();
status = hsa_ext_sampler_create(dev().getBackendDevice(), &samplerDescriptor, &hsa_sampler);
if (status != HSA_STATUS_SUCCESS) {
LogError("Error creating device sampler object!");