1. A computer implemented method comprising: in response to receiving a capability requirement, accessing data structure storing processing capabilities for each of a plurality of processing units to determine a matching score for each of the plurality of processing units, each matching score indicating how many of all of the processing capabilities of a processing unit stored in the data structure match the capability requirement, the plurality of processing units including central processing units (CPUs) and graphics processing units (GPUs), the capability requirement including support for a dedicated local storage; selecting one of the plurality of processing units according to a comparison among matching scores of the processing units, wherein the processing capabilities indicate whether the selected processing unit supports the dedicated local storage and whether the selected processing unit is capable of the hardware support for the graphics operation; loading an executable compiled from a program source to be executed in the selected processing units, the program source including a variable declared to be allocated in a local memory shared by multiple threads of the selected processing unit; and determining where to allocate memory location for the local memory of the variable for the executable in the selected processing unit, wherein the local memory is allocated in a stream memory shared by more than one of the plurality of processing units if the selected processing units does not support the dedicated local storage for the local memory.