Changeset 3155 in CLRX


Ignore:
Timestamp:
Jun 14, 2017, 8:32:15 PM (2 years ago)
Author:
matszpk
Message:

CLRadeonExtender: CLUtils: fixed getting device version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/samples/CLUtils.cpp

    r3153 r3155  
    283283            { } // ignore error
    284284        }
    285         const char* mesaPart = strstr(deviceName.get(), "Mesa ");
     285       
     286        size_t deviceVersionSize;
     287        std::unique_ptr<char[]> deviceVersion;
     288        error = clGetDeviceInfo(device, CL_DEVICE_VERSION, 0, nullptr, &deviceVersionSize);
     289        if (error != CL_SUCCESS)
     290            throw CLError(error, "clGetDeviceInfoVersion");
     291        deviceVersion.reset(new char[deviceVersionSize]);
     292        error = clGetDeviceInfo(device, CL_DEVICE_VERSION, deviceVersionSize,
     293                                deviceVersion.get(), nullptr);
     294        if (error != CL_SUCCESS)
     295            throw CLError(error, "clGetDeviceInfoVersion");
     296       
     297        const char* mesaPart = strstr(deviceVersion.get(), "Mesa ");
    286298        if (mesaPart!=nullptr)
    287299        {
Note: See TracChangeset for help on using the changeset viewer.