[Beignet] [PATCH] Runtime: Add default extension for platforms before BDW.
junyan.he at inbox.com
junyan.he at inbox.com
Mon Jul 13 08:38:22 PDT 2015
From: Junyan He <junyan.he at linux.intel.com>
Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
src/cl_device_id.c | 4 ++++
src/cl_extensions.c | 8 ++++++++
src/cl_extensions.h | 2 ++
3 files changed, 14 insertions(+)
diff --git a/src/cl_device_id.c b/src/cl_device_id.c
index f995550..f772278 100644
--- a/src/cl_device_id.c
+++ b/src/cl_device_id.c
@@ -353,6 +353,7 @@ has_break:
device->vendor_id = device_id;
device->platform = cl_get_platform_default();
ret = device;
+ cl_intel_platform_get_default_extension(ret);
break;
case PCI_CHIP_IVYBRIDGE_GT1:
@@ -365,6 +366,7 @@ ivb_gt1_break:
intel_ivb_gt1_device.vendor_id = device_id;
intel_ivb_gt1_device.platform = cl_get_platform_default();
ret = &intel_ivb_gt1_device;
+ cl_intel_platform_get_default_extension(ret);
break;
case PCI_CHIP_IVYBRIDGE_GT2:
@@ -377,6 +379,7 @@ ivb_gt2_break:
intel_ivb_gt2_device.vendor_id = device_id;
intel_ivb_gt2_device.platform = cl_get_platform_default();
ret = &intel_ivb_gt2_device;
+ cl_intel_platform_get_default_extension(ret);
break;
case PCI_CHIP_BAYTRAIL_T:
@@ -385,6 +388,7 @@ baytrail_t_device_break:
intel_baytrail_t_device.vendor_id = device_id;
intel_baytrail_t_device.platform = cl_get_platform_default();
ret = &intel_baytrail_t_device;
+ cl_intel_platform_get_default_extension(ret);
break;
case PCI_CHIP_BROADWLL_M_GT1:
diff --git a/src/cl_extensions.c b/src/cl_extensions.c
index a34aaca..3eb303f 100644
--- a/src/cl_extensions.c
+++ b/src/cl_extensions.c
@@ -94,6 +94,14 @@ process_extension_str(cl_extensions_t *extensions)
}
}
+LOCAL void
+cl_intel_platform_get_default_extension(cl_device_id device)
+{
+ cl_platform_id pf = device->platform;
+ memcpy((char*)device->extensions,
+ pf->internal_extensions->ext_str, sizeof(device->extensions));
+ device->extensions_sz = strlen(pf->internal_extensions->ext_str) + 1;
+}
LOCAL void
cl_intel_platform_enable_fp16_extension(cl_device_id device)
diff --git a/src/cl_extensions.h b/src/cl_extensions.h
index 426986c..b4544e2 100644
--- a/src/cl_extensions.h
+++ b/src/cl_extensions.h
@@ -96,3 +96,5 @@ extern void
cl_intel_platform_extension_init(cl_platform_id intel_platform);
extern void
cl_intel_platform_enable_fp16_extension(cl_device_id device);
+extern void
+cl_intel_platform_get_default_extension(cl_device_id device);
--
1.7.9.5
More information about the Beignet
mailing list