How to get platform info using OpenCL in C

1 Answer

0 votes
#include <stdio.h>

//#define CL_USE_DEPRECATED_OPENCL_2_0_APIS

#include "opencl.h"
//#include "CL/cl.h"


int main(void)
{
    cl_platform_id platform;
    cl_uint platforms;

    clGetPlatformIDs(1, &platform, &platforms);

    char buf[64] = { 0 };
    clGetPlatformInfo(platform,
                      CL_PLATFORM_VENDOR,
                      sizeof(buf),
                      buf,
                      NULL);

    puts(buf);

    char ch = getchar();

    return 0;
}



/*
run:

NVIDIA Corporation

*/

 



answered Mar 26, 2022 by avibootz
edited Mar 26, 2022 by avibootz

Related questions

1 answer 288 views
1 answer 306 views
306 views asked Mar 26, 2022 by avibootz
1 answer 276 views
2 answers 299 views
2 answers 318 views
1 answer 170 views
1 answer 267 views
...