Hi,

does the attached patch fix your problem?
what compiler are you using?

regards,
Jan

On Wed, 2016-05-25 at 17:59 +0200, Jose Luis Cercós wrote:
> Hi community!
> 
> I have a some kind of strange error. When I execute the test
> tests/cl/api/get-device-ids.c, num_device_types is always zero
> (please, not
> that such variable should not depend on the hardware/drivers).
> 
> To check what is going on, I'm printing some variables:
> 
> env->version = 12
> piglit_cl_device_type_num_1_0 = 0
> piglit_cl_device_type_num_1_1 = 0
> piglit_cl_device_type_num_1_2 = 0
> num_device_types = 0
> 
> So it seems that piglit_cl_device_type_num_1_x variables have not be
> set at
> all. However, I checked that the test is linked against
> lib/libpiglitutil.so.0.
> 
> I'm using the last git version from here (Ubuntu 15.10):
> git://anongit.freedesktop.org/git/piglit
> 
> I did not check other expansions of PIGLIT_CL_ENUM_NUM.
> 
> Any hint on what is going wrong will be welcomed.
> 
> Thanks!
> Pepe
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
-- 
Jan Vesely <jan.ves...@rutgers.edu>
From b93518bb0ed09b229fb5a782210a35bc79a2c868 Mon Sep 17 00:00:00 2001
From: Jan Vesely <jan.ves...@rutgers.edu>
Date: Wed, 25 May 2016 13:05:20 -0400
Subject: [Piglit][PATCH 1/1] cl: declare enum counts as extern

Signed-off-by: Jan Vesely <jan.ves...@rutgers.edu>
---
 tests/util/piglit-util-cl-enum.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/util/piglit-util-cl-enum.h b/tests/util/piglit-util-cl-enum.h
index e08d3c3..1791531 100644
--- a/tests/util/piglit-util-cl-enum.h
+++ b/tests/util/piglit-util-cl-enum.h
@@ -71,10 +71,10 @@ const char* piglit_cl_get_error_name(cl_int error);
 
 
 #define PIGLIT_CL_DEFINE_ENUM_PROTOTYPE(type, name)    \
-        const unsigned int piglit_##name##_num_1_0;    \
-        const unsigned int piglit_##name##_num_1_1;    \
-        const unsigned int piglit_##name##_num_1_2;    \
-        const type* piglit_##name;
+        extern const unsigned int piglit_##name##_num_1_0;    \
+        extern const unsigned int piglit_##name##_num_1_1;    \
+        extern const unsigned int piglit_##name##_num_1_2;    \
+        extern const type* piglit_##name;
 
 #define PIGLIT_CL_DEFINE_ENUM_PROTOTYPE_2(name)        \
         PIGLIT_CL_DEFINE_ENUM_PROTOTYPE(name, name)
-- 
2.5.5

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to