Hi developers,
Does the host (CPU) side modify the source code before
it is sent to GPU to be executed with clCreateProgramWithSource ?
For example, will program comments be sent from CPU to GPU ?
thanks in advance !
of cource. it must compile just like any other source code into executable binary.
clCreateProgramWithSource generally creates a program object which is used by cl compiler. The program object is compiled by clBuildProgram. The comments would surely be ignored at this stage.
Hi Nou,
Yes, a source program gets compiled without comments.
Therefore CPU did not have to send comments to GPU but
instead it could send a source without comments.
Q1.
Are comments being sent to GPU ?
Q2.
Is a source sent from CPU to GPU as it is without any modification ?
Q3.
Will the GPU compiler receive a source exactly as it was sent by CPU ?
thanks in advance
no whole compilation is done on CPU. what GPU get is this
and of course compiler will get whole source code. if you are interested in hide your code then dont ship kernel code at all.
00 ALU_PUSH_BEFORE: ADDR(32) CNT(13) KCACHE0(CB1:0-15) KCACHE1(CB0:0-15) 0 x: MOV R9.x, 0.0f y: MOV R9.y, 0.0f z: MOV R9.z, 0.0f w: MOV R9.w, 0.0f t: LSHR R10.y, KC0[4].x, (0x00000002, 2.802596929e-45f).x 1 t: MULLO_INT ____, R1.x, KC1[1].x 2 w: ADD_INT ____, R0.x, PS1 t: MULLO_INT ____, R1.y, KC1[1].y 3 x: ADD_INT R10.x, PV2.w, KC1[6].x z: ADD_INT ____, R0.y, PS2 4 y: ADD_INT R11.y, PV3.z, KC1[6].y 5 x: PREDNE_INT ____, KC0[3].x, 0.0f UPDATE_EXEC_MASK UPDATE_PRED 01 JUMP ADDR(9) 02 ALU: ADDR(45) CNT(38) KCACHE0(CB1:0-15) 6 x: LSHL ____, R11.y, (0x00000002, 2.802596929e-45f).x y: AND_INT T0.y, KC0[4].x, (0x0FFFFFFC, 2.524354295e-29f).y z: LSHR T1.z, KC0[3].x, (0x00000002, 2.802596929e-45f).x w: LSHL T0.w, R10.x, (0x00000004, 5.605193857e-45f).z t: MOV R9.x, 0.0f 7 x: OR_INT T0.x, PV6.x, 1 y: OR_INT T1.y, PV6.x, (0x00000002, 2.802596929e-45f).x z: LSHR ____, KC0[4].x, 1 w: OR_INT T1.w, PV6.x, (0x00000003, 4.203895393e-45f).y t: AND_INT T0.z, (0xFFFFFFFC, 0.-nanf).z, KC0[3].x 8 x: MOV R12.x, 0.0f y: MOV R9.y, 0.0f z: LSHL R10.z, T0.y, (0x00000004, 5.605193857e-45f).x w: ADD_INT R1.w, KC0[1].x, T0.w t: AND_INT R11.z, (0x7FFFFFFE, 0.nanf).y, PV7.z 9 x: MOV R13.x, 0.0f y: MOV R0.y, 0.0f z: MOV R9.z, 0.0f w: MOV R9.w, 0.0f t: MOV R12.y, 0.0f
Hi Nou !
We embed some stuff as comments in source files and
just wanted to be 100% sure.
THANKS !