[Mesa-dev] [PATCH 1/2] clover/device: Get device/host unified memory from pipe driver

Francisco Jerez currojerez at riseup.net
Tue Jun 13 19:03:08 UTC 2017


Aaron Watry <awatry at gmail.com> writes:

> Humble ping for this one.
>

Thanks for CC'ing me on this -- Patch is:

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> --Aaron
>
> On Sun, Jun 4, 2017 at 7:32 PM, Aaron Watry <awatry at gmail.com> wrote:
>> clinfo no longer reports my discrete GCN card as unified memory
>>
>> Signed-off-by: Aaron Watry <awatry at gmail.com>
>> ---
>>  src/gallium/state_trackers/clover/api/device.cpp  | 2 +-
>>  src/gallium/state_trackers/clover/core/device.cpp | 5 +++++
>>  src/gallium/state_trackers/clover/core/device.hpp | 1 +
>>  3 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
>> index a80ca46654..0b33350bb2 100644
>> --- a/src/gallium/state_trackers/clover/api/device.cpp
>> +++ b/src/gallium/state_trackers/clover/api/device.cpp
>> @@ -336,7 +336,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
>>        break;
>>
>>     case CL_DEVICE_HOST_UNIFIED_MEMORY:
>> -      buf.as_scalar<cl_bool>() = CL_TRUE;
>> +      buf.as_scalar<cl_bool>() = dev.has_unified_memory();
>>        break;
>>
>>     case CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR:
>> diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
>> index 158c9aa696..8dfba1ad9f 100644
>> --- a/src/gallium/state_trackers/clover/core/device.cpp
>> +++ b/src/gallium/state_trackers/clover/core/device.cpp
>> @@ -189,6 +189,11 @@ device::has_doubles() const {
>>     return pipe->get_param(pipe, PIPE_CAP_DOUBLES);
>>  }
>>
>> +bool
>> +device::has_unified_memory() const {
>> +   return pipe->get_param(pipe, PIPE_CAP_UMA);
>> +}
>> +
>>  std::vector<size_t>
>>  device::max_block_size() const {
>>     auto v = get_compute_param<uint64_t>(pipe, ir_format(),
>> diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp
>> index 94a61d1050..7b3353df34 100644
>> --- a/src/gallium/state_trackers/clover/core/device.hpp
>> +++ b/src/gallium/state_trackers/clover/core/device.hpp
>> @@ -67,6 +67,7 @@ namespace clover {
>>        cl_uint max_compute_units() const;
>>        bool image_support() const;
>>        bool has_doubles() const;
>> +      bool has_unified_memory() const;
>>
>>        std::vector<size_t> max_block_size() const;
>>        cl_uint subgroup_size() const;
>> --
>> 2.11.0
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170613/0da1bfe5/attachment.sig>


More information about the mesa-dev mailing list