Lines Matching full:cgf
66 void emitDeviceStubBody(CodeGenFunction &CGF, FunctionArgList &Args);
71 void emitDeviceStub(CodeGenFunction &CGF, FunctionArgList &Args) override;
113 void CGNVCUDARuntime::emitDeviceStub(CodeGenFunction &CGF,
115 EmittedKernels.push_back(CGF.CurFn);
116 emitDeviceStubBody(CGF, Args);
119 void CGNVCUDARuntime::emitDeviceStubBody(CodeGenFunction &CGF,
126 llvm::Value *V = CGF.GetAddrOfLocalVar(*I).getPointer();
133 llvm::BasicBlock *EndBlock = CGF.createBasicBlock("setup.end");
139 llvm::BasicBlock *NextBlock = CGF.createBasicBlock("setup.next");
140 Args[0] = CGF.Builder.CreatePointerCast(ArgValues[I], VoidPtrTy);
141 Args[1] = CGF.Builder.CreateIntCast(
144 Args[2] = CGF.Builder.CreateIntCast(
147 llvm::CallSite CS = CGF.EmitRuntimeCallOrInvoke(cudaSetupArgFn, Args);
149 llvm::Value *CSZero = CGF.Builder.CreateICmpEQ(CS.getInstruction(), Zero);
150 CGF.Builder.CreateCondBr(CSZero, NextBlock, EndBlock);
151 CGF.EmitBlock(NextBlock);
156 llvm::Value *Arg = CGF.Builder.CreatePointerCast(CGF.CurFn, CharPtrTy);
157 CGF.EmitRuntimeCallOrInvoke(cudaLaunchFn, Arg);
158 CGF.EmitBranch(EndBlock);
160 CGF.EmitBlock(EndBlock);