We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 859ed1f commit 6c0ad40Copy full SHA for 6c0ad40
lib/polygeist/Passes/ParallelLower.cpp
@@ -506,7 +506,15 @@ void ParallelLower::runOnOperation() {
506
} else if (callee == "cudaMemset") {
507
OpBuilder bz(call);
508
auto falsev = bz.create<ConstantIntOp>(call->getLoc(), false, 1);
509
- bz.create<LLVM::MemsetOp>(call->getLoc(), call->getOperand(0),
+ auto dst = call->getOperand(0);
510
+ if (auto mt = dst.getType().dyn_cast<MemRefType>()) {
511
+ dst = bz.create<polygeist::Memref2PointerOp>(
512
+ call->getLoc(),
513
+ LLVM::LLVMPointerType::get(mt.getElementType(),
514
+ mt.getMemorySpaceAsInt()),
515
+ dst);
516
+ }
517
+ bz.create<LLVM::MemsetOp>(call->getLoc(), dst,
518
bz.create<TruncIOp>(call->getLoc(),
519
bz.getI8Type(),
520
call->getOperand(1)),
0 commit comments