Added some logic to avoid DeviceAPI::Parent.
Added some logic to avoid DeviceAPI::Parent.


Former-commit-id: 3c4f4b3f5d38223fb13764b1cc91394267e502f1
darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide