OpenCL (xi) ---- shuffling, selection

Shuffling function

You can refer to:  https://www.khronos.org/registry/OpenCL/sdk/1.1/docs/man/xhtml/shuffle.html

// create a vector x containing the elements, which elements contain mask control 
gentypen shuffle (    
     gentypem x,
     ugentypen mask
)


gentypen shuffle2 (    
     gentypem x,
     gentypem and,
     ugentypen mask
)

 

 

Select function

Reference: https://www.khronos.org/registry/OpenCL/sdk/1.1/docs/man/xhtml/bitselect.html

           https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/select.html

gentype select (	
        gentype a,
 	gentype b,
 	igentype c
) gentype select (
gentype a, gentype b, ugentype c
) gentype bitselect ( gentype a, gentype b, gentype c )

 

 

Guess you like

Origin www.cnblogs.com/feihu-h/p/12098126.html