cl_getplatforminfo.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2012 University of Bordeaux
  4. * Copyright (C) 2012 CNRS
  5. * Copyright (C) 2012 Vincent Danjean <Vincent.Danjean@ens-lyon.org>
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #include "socl.h"
  19. #include "getinfo.h"
  20. /**
  21. * \brief Get information about StarPU platform
  22. *
  23. * \param[in] platform StarPU platform ID or NULL
  24. */
  25. CL_API_ENTRY cl_int CL_API_CALL
  26. soclGetPlatformInfo(cl_platform_id platform,
  27. cl_platform_info param_name,
  28. size_t param_value_size,
  29. void * param_value,
  30. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0
  31. {
  32. if (platform != NULL && platform != &socl_platform)
  33. return CL_INVALID_PLATFORM;
  34. switch (param_name)
  35. {
  36. INFO_CASE_STRING(CL_PLATFORM_PROFILE, SOCL_PROFILE);
  37. INFO_CASE_STRING(CL_PLATFORM_VERSION, SOCL_VERSION);
  38. INFO_CASE_STRING(CL_PLATFORM_NAME, SOCL_PLATFORM_NAME);
  39. INFO_CASE_STRING(CL_PLATFORM_VENDOR, SOCL_VENDOR);
  40. INFO_CASE_STRING(CL_PLATFORM_EXTENSIONS, SOCL_PLATFORM_EXTENSIONS);
  41. INFO_CASE_STRING(CL_PLATFORM_ICD_SUFFIX_KHR, SOCL_PLATFORM_ICD_SUFFIX_KHR);
  42. default:
  43. return CL_INVALID_VALUE;
  44. }
  45. return CL_SUCCESS;
  46. }