cl_getplatforminfo.c 1.8 KB

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