P4 to Git Change 1481252 by gandryey@gera-lnx-rcf on 2017/11/10 12:11:16
SWDEV-133810 - PAL support for Linux Pro w/OpenCL 1.2 support - Fix a crash in offline compilation. Increase the alignment for sysmem allocation. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#48 edit
This commit is contained in:
@@ -971,8 +971,10 @@ void* PALHSALoaderContext::SegmentAlloc(amdgpu_hsa_elf_segment_t segment, hsa_ag
|
||||
assert(size);
|
||||
assert(align);
|
||||
if (program_->isNull()) {
|
||||
// Note: In Linux ::posix_memalign() requires at least 16 bytes for the alignment.
|
||||
align = amd::alignUp(align, 16);
|
||||
void* ptr = amd::Os::alignedMalloc(size, align);
|
||||
if (zero) {
|
||||
if ((ptr != nullptr) && zero) {
|
||||
memset(ptr, 0, size);
|
||||
}
|
||||
return ptr;
|
||||
|
||||
Reference in New Issue
Block a user