MCPcopy Create free account
hub / github.com/ROCm/clr / getNumChannels

Method getNumChannels

rocclr/platform/memory.cpp:767–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765}
766
767size_t Image::Format::getNumChannels() const {
768 switch (image_channel_order) {
769 case CL_RG:
770 case CL_RA:
771 return 2;
772
773 case CL_RGB:
774 case CL_sRGB:
775 case CL_sRGBx:
776 return 3;
777
778 case CL_RGBA:
779 case CL_BGRA:
780 case CL_ARGB:
781 case CL_sRGBA:
782 case CL_sBGRA:
783 return 4;
784 }
785 return 1;
786}
787
788size_t Image::Format::getElementSize() const {
789 size_t bytesPerPixel = getNumChannels();

Calls

no outgoing calls

Tested by

no test coverage detected