Actually, you can leave this inline functions as is, but change a bit `DeviceInfo::query` method:

    void cv::gpu::DeviceInfo::query() 
    {
        deviceInfoFuncTable()->query();
        name_ = deviceInfoFuncTable()->name();;
        multi_processor_count_ = deviceInfoFuncTable()->multiProcessorCount();;
        majorVersion_ = deviceInfoFuncTable()->majorVersion();;
        minorVersion_ = deviceInfoFuncTable()->minorVersion();;
    }

Thus `gpumat.hpp` header will be not touched.