devices.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2012 University of Bordeaux
  4. * Copyright (C) 2012 CNRS
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #ifndef SOCL_DEVICES_H
  18. #define SOCL_DEVICES_H
  19. #include "socl.h"
  20. // OpenCL 1.0 : Mandatory format: major_number.minor_number
  21. const char * SOCL_DRIVER_VERSION;
  22. const cl_uint SOCL_DEVICE_VENDOR_ID;
  23. struct _cl_device_id {
  24. struct _cl_icd_dispatch * dispatch;
  25. cl_device_type type;
  26. cl_uint max_compute_units; //OpenCL 1.0: minimum value is 1
  27. cl_uint max_work_item_dimensions; //OpenCL 1.0: minimum value is 3
  28. size_t max_work_item_sizes[3]; //array size should be set accordingly to the maximum max_work_item_dimensions
  29. size_t max_work_group_size; //OpenCL 1.0: minimum value is 1
  30. cl_uint preferred_vector_widths[6]; //Char, Short, Int, Long, Float, Double
  31. cl_uint max_clock_frequency;
  32. cl_uint address_bits; //OpenCL 1.0: 32 or 64
  33. cl_ulong max_mem_alloc_size; //OpenCL 1.0: minimum value is max(CL_DEVICE_GLOBAL_MEM_SIZE/4, 128*1024*1024)
  34. cl_bool image_support;
  35. //image fields not present
  36. size_t max_parameter_size; //OpenCL 1.0: minimum is 256
  37. cl_uint mem_base_addr_align;
  38. cl_uint min_data_type_align_size;
  39. cl_device_fp_config single_fp_config; //OpenCL 1.0: CL_FP_ROUND_TO_NEAREST and CL_FP_INF_NAN are mandatory
  40. cl_device_mem_cache_type global_mem_cache_type;
  41. cl_uint global_mem_cacheline_size;
  42. cl_ulong global_mem_cache_size;
  43. cl_ulong global_mem_size;
  44. cl_ulong max_constant_buffer_size; //OpenCL 1.0: minimum value is 64KB
  45. cl_uint max_constant_args; //OpenCL 1.0: minimum value is 8
  46. cl_device_local_mem_type local_mem_type;
  47. cl_ulong local_mem_size; //OpenCL 1.0: minimum value is 16KB
  48. cl_bool error_correction_support;
  49. size_t profiling_timer_resolution;
  50. cl_bool endian_little;
  51. cl_bool available;
  52. cl_bool compiler_available; //OpenCL 1.0: mandatory for FULL_PROFILE platforms
  53. cl_device_exec_capabilities execution_capabilities; //OpenCL 1.0: CL_EXEC_KERNEL is mandatory
  54. cl_command_queue_properties queue_properties; //OpenCL 1.0: CL_QUEUE_PROFILING_ENABLE is mandatory
  55. char name[40]; //Array size has been arbitrarily defined
  56. //versions, profile and vendor are statically defined for all devices
  57. char extensions[100]; //Array size has been arbitrarily defined
  58. };
  59. const struct _cl_device_id socl_devices[100];
  60. const int socl_device_count;
  61. #endif /* SOCL_DEVICES_H */