Method: Ikra::Symbolic::ArrayCommand#post_execute

Defined in:
lib/symbolic/symbolic.rb

#post_execute(environment) ⇒ Object

This method is executed after execution of the parallel section has finish. The boolean return value indicates if a change has been registered or not.



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/symbolic/symbolic.rb', line 289

def post_execute(environment)
    if keep
        # The (temporary) result of this command should be kept on the GPU. Store a
        # pointer to the result in global memory in an instance variable.

        begin
            @gpu_result_pointer = environment[("prev_" + unique_id.to_s).to_sym].to_i
            Log.info("Kept pointer for result of command #{unique_id.to_s}: #{@gpu_result_pointer}")
            return true  
        rescue ArgumentError
            # No pointer saved for this command. This can happen if the result of this
            # command was already cached earlier and the cached result of a
            # computation based on this command was used now. 
            Log.info("No pointer kept for result of command #{unique_id.to_s}.")
            return false
        end
    end

    return false
end