Remove duplicate definition of align_{malloc,free} (#631)

Also use it instead of duplicating the code.

Fixes #326

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
Kévin Petit
2020-02-28 12:22:38 +00:00
committed by GitHub
parent b95ef1ad04
commit b93c1df933
5 changed files with 72 additions and 99 deletions

View File

@@ -38,6 +38,7 @@
#endif
#include "deviceInfo.h"
#include "harness/alloc.h"
#ifdef __cplusplus
extern "C" {
@@ -149,10 +150,6 @@ extern int checkFor3DImageSupport( cl_device_id device );
/* Checks that a given queue property is supported on the specified device. Returns 1 if supported, 0 if not or an error. */
extern int checkDeviceForQueueSupport( cl_device_id device, cl_command_queue_properties prop );
/* Helper for aligned memory allocation */
void * align_malloc(size_t size, size_t alignment);
void align_free(void *);
/* Helper to obtain the min alignment for a given context, i.e the max of all min alignments for devices attached to the context*/
size_t get_min_alignment(cl_context context);