freebsd-ports/lang/beignet/files/patch-utests_image__from__buffer.cpp
Matthew Rezny 0cb60b6774 Update to 1.3.1
- Enable OpenCL 2.0 on AMD64
- Add options FP64 (experimental) and TEST [1]
- Follow MESA_LLVM_VER if set, currently only 39 works for this port

PR:		217771 [1]
Submitted by:	jbeich [1]
Approved by:	swills (mentor)
Differential Revision:	https://reviews.freebsd.org/D10251
2017-04-07 19:30:11 +00:00

20 lines
646 B
C++

--- utests/image_from_buffer.cpp.orig 2017-03-13 21:06:07 UTC
+++ utests/image_from_buffer.cpp
@@ -1,6 +1,6 @@
#include <string.h>
#include "utest_helper.hpp"
-#include <malloc.h>
+#include <cstdlib>
#include <cstring>
static void image_from_buffer(void)
@@ -33,8 +33,7 @@ static void image_from_buffer(void)
// Setup kernel and images
size_t buffer_sz = sizeof(uint32_t) * w * h;
uint32_t* src_data;
- src_data = (uint32_t*)memalign(base_address_alignment, buffer_sz);
- if(!src_data) {
+ if(posix_memalign((void**)&src_data, base_address_alignment, buffer_sz)) {
fprintf(stderr, "run out of memory\n");
return;
}