1. A device, comprising: at least one processor and a memory, the at least one processor configured to: generate, during runtime execution of user code, a compute device object and a resource view object in accordance with directives in the user code, the compute device object generated with a device level specified in the user code, the device level indicating a type of compute node, the resource view object generated with a first resource level specified in the user code, the first resource level indicating a type of runtime library for use in execution of the user code; obtain an annotation associated with a code portion in the user code, the annotation identifying the code portion as a data parallel function and includes a second resource level indicating a type of runtime library for use in execution of the code portion, wherein the first resource level differs from the second resource level; and execute the data parallel function using a compute node corresponding to the device level and the first resource level when the first resource level has fewer or same semantic restrictions as the second resource level.