This works in OptiX 3.0 and 3.5 but I can't guarantee it will always work. We should provide a real API for this in a future version.
namespace rti_internal_register
{
__device__ unsigned reg_device_id;
}
rtBuffer<uchar4, 2> output_buffer;
RT_PROGRAM void pinhole_camera()
{
if( rti_internal_register::reg_device_id == 0 )
output_buffer[launch_index] = make_color( make_float3( 0.5, 0.0, 0.0 ) );
else
output_buffer[launch_index] = make_color( make_float3( 0.0, 0.5, 0.0 ) );
}