devices.h 3.1 KB

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