cl_icdgetplatformidskhr.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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) 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. extern int _starpu_init_failed;
  21. CL_EXT_SUFFIX__VERSION_1_0
  22. CL_API_ENTRY cl_int CL_API_CALL soclIcdGetPlatformIDsKHR(cl_uint num_entries,
  23. cl_platform_id *platforms,
  24. cl_uint *num_platforms)
  25. {
  26. if ((num_entries == 0 && platforms != NULL)
  27. || (num_platforms == NULL && platforms == NULL))
  28. return CL_INVALID_VALUE;
  29. else
  30. {
  31. if (platforms != NULL)
  32. platforms[0] = &socl_platform;
  33. if (num_platforms != NULL)
  34. *num_platforms = 1;
  35. }
  36. return CL_SUCCESS;
  37. }