From 85c956e69c6206a2552ddd8cb75d45fa61c6d5a8 Mon Sep 17 00:00:00 2001 From: David Hilvert Date: Fri, 14 Aug 2009 19:06:40 +0000 Subject: [PATCH] include/ale: Code for storing pointers across architectures (e.g., between host and compute device). This code quite likely will be moved elsewhere. --- include/ale.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/ale.h b/include/ale.h index 7e59c52..b178e18 100644 --- a/include/ale.h +++ b/include/ale.h @@ -37,6 +37,26 @@ #include /* + * Pointer for portable storage (e.g., between 32- and 64-bit architectures). + * This might eventually be moved to some other location common to compute + * target and host code (if this include file does not eventually serve such + * role). This may allow, e.g., storing compute device pointers on the host, + * which could be useful for inclusion in structures, etc. + */ + +typedef union { + void *p; + cl_long widest_pointer_type; +} ale_ptr; + +/* + * An alternative formulation of the above. + */ + +#define ALE_POINTER(TYPE, TYPEP) \ + typedef union { TYPE *p; cl_long widest_pointer_type; } TYPEP; + +/* * Macro for API type definition * * API type name selection is based roughly on the approach taken in -- 2.11.4.GIT