MCPcopy Create free account
hub / github.com/RenderKit/oidn / ImageAccessor

Method ImageAccessor

devices/cpu/cpu_common.cpp:12–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#endif
11
12OIDN_NAMESPACE_BEGIN
13
14 Image::operator ispc::ImageAccessor()
15 {
16 ispc::ImageAccessor acc;
17 acc.ptr = reinterpret_cast<int8_t*>(ptr);
18 acc.hByteStride = hByteStride;
19 acc.wByteStride = wByteStride;
20
21 switch (getDataType())
22 {
23 case DataType::Undefined:
24 acc.dataType = ispc::DataType_Undefined;
25 break;
26 /*
27 case DataType::UInt8:
28 acc.dataType = ispc::DataType_UInt8;
29 break;
30 */
31 case DataType::Float16:
32 acc.dataType = ispc::DataType_Float16;
33 break;
34 case DataType::Float32:
35 acc.dataType = ispc::DataType_Float32;
36 break;
37 default:
38 throw std::logic_error("unsupported data type");
39 }
40
41 acc.C = getC();
42 if (acc.C > 3)
43 throw std::logic_error("unsupported number of channels for image accessor");
44 acc.H = getH();
45 acc.W = getW();
46
47 return acc;
48 }
49
50#if !defined(OIDN_BNNS)
51 Tensor::operator ispc::TensorAccessor3D_ChwBc()

Callers

nothing calls this directly

Calls 4

getDataTypeFunction · 0.85
getCFunction · 0.85
getHFunction · 0.85
getWFunction · 0.85

Tested by

no test coverage detected