[Mesa-dev] [PATCH] clover: Allow OpenCL version override

Vedran Miletić vedran at miletic.net
Thu Oct 13 18:01:57 UTC 2016


On 10/13/2016 07:45 PM, Vedran Miletić wrote:
> On 10/07/2016 12:05 PM, Serge Martin wrote:
>> On Thursday 06 October 2016 16:26:21 Vedran Miletić wrote:
>>> PACKAGE_VERSION #ifdef MESA_GIT_SHA1
>>>                          " (" MESA_GIT_SHA1 ")"
>>>  #endif
>>> diff --git a/src/gallium/state_trackers/clover/core/device.cpp
>>> b/src/gallium/state_trackers/clover/core/device.cpp index 8825f99..fce6fb3
>>> 100644
>>> --- a/src/gallium/state_trackers/clover/core/device.cpp
>>> +++ b/src/gallium/state_trackers/clover/core/device.cpp
>>> @@ -24,6 +24,7 @@
>>>  #include "core/platform.hpp"
>>>  #include "pipe/p_screen.h"
>>>  #include "pipe/p_state.h"
>>> +#include "util/u_debug.h"
>>>
>>>  using namespace clover;
>>>
>>> @@ -48,6 +49,14 @@ device::device(clover::platform &platform,
>>> pipe_loader_device *ldev) : pipe->destroy(pipe);
>>>        throw error(CL_INVALID_DEVICE);
>>>     }
>>> +
>>> +   const std::string cl_version_override =
>>> +                             debug_get_option("CLOVER_CL_VERSION_OVERRIDE",
>>> ""); +   ocl_version = !cl_version_override.empty() ? cl_version_override :
>>> "1.1";
>>
>> This is what the default value of debug_get_option is for, this is redundant. 
>> You just have to pass "1.1".
>>
>> Also, if we have a util function that statistically keep the value the extra 
>> device variable and funcs are not needed.
>> We may need it if we go for CL 2.0 latter with some devices only advertising 
>> CL 1.2 because of unsupported feature, but not for the moment.
>>
> 
> Thanks for the default value comment, did not know it. Will fix it. I do
> agree with a util function that would return "1.1" until we choose to
> bump it. However I would prefer to have function per-device because we
> will eventually need to do it like that anyway.
> 

On a second thought, I believe you are right on this one. I will simplify.

Regards,
Vedran

-- 
Vedran Miletić
vedran.miletic.net


More information about the mesa-dev mailing list