Skip to content

Commit

Permalink
Merge branch 'next' of github.com:LuisaGroup/LuisaCompute into next
Browse files Browse the repository at this point in the history
  • Loading branch information
shiinamiyuki committed Jul 25, 2023
2 parents 82b76f4 + 548dc9a commit 2ca4e80
Show file tree
Hide file tree
Showing 133 changed files with 257 additions and 44 deletions.
1 change: 1 addition & 0 deletions include/luisa/ast/op.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ enum struct CallOp : uint32_t {

// indirect
INDIRECT_CLEAR_DISPATCH_BUFFER, // (Buffer): void
INDIRECT_SET_DISPATCH_KERNEL,// (Buffer, uint offset, uint3 block_size, uint3 dispatch_size, uint kernel_id)
INDIRECT_EMPLACE_DISPATCH_KERNEL,// (Buffer, uint3 block_size, uint3 dispatch_size, uint kernel_id)

};
Expand Down
9 changes: 8 additions & 1 deletion include/luisa/dsl/dispatch_indirect.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ struct LC_DSL_API Expr<IndirectDispatchBuffer> {
void dispatch_kernel(Expr<uint3> block_size, Expr<uint3> dispatch_size) const noexcept {
dispatch_kernel(block_size, dispatch_size, 0u);
}
void set_kernel(Expr<uint> offset, Expr<uint3> block_size, Expr<uint3> dispatch_size, Expr<uint> kernel_id) const noexcept;
void set_kernel(Expr<uint> offset, Expr<uint3> block_size, Expr<uint3> dispatch_size) const noexcept {
set_kernel(offset, block_size, dispatch_size, 0u);
}
[[nodiscard]] auto operator->() const noexcept { return this; }
};

Expand Down Expand Up @@ -59,9 +63,12 @@ class LC_DSL_API IndirectDispatchBufferExprProxy {
void dispatch_kernel(Expr<uint3> block_size, Expr<uint3> dispatch_size) const noexcept {
dispatch_kernel(block_size, dispatch_size, 0u);
}
void set_kernel(Expr<uint> offset, Expr<uint3> block_size, Expr<uint3> dispatch_size, Expr<uint> kernel_id) const noexcept;
void set_kernel(Expr<uint> offset, Expr<uint3> block_size, Expr<uint3> dispatch_size) const noexcept {
set_kernel(offset, block_size, dispatch_size, 0u);
}
};

}// namespace detail

}// namespace luisa::compute

2 changes: 2 additions & 0 deletions include/luisa/ir/fwd.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once
#include <luisa/core/dll_export.h>
#include <luisa/core/concepts.h>
#include <luisa/core/stl/memory.h>
#include <luisa/rust/ir.hpp>
namespace luisa::compute::ir_v2 {
namespace raw = luisa::compute::ir;
Expand Down
4 changes: 2 additions & 2 deletions include/luisa/runtime/shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ class Shader final : public Resource {
Function kernel,
const ShaderOption &option) noexcept
: Shader{device, device->create_shader(option, kernel),
static_cast<uint>(kernel.arguments().size()),
ShaderDispatchCmdEncoder::compute_uniform_size(kernel.arguments())} {}
static_cast<uint>(kernel.unbound_arguments().size()),
ShaderDispatchCmdEncoder::compute_uniform_size(kernel.unbound_arguments())} {}

#ifdef LUISA_ENABLE_IR
// JIT shader from IR module
Expand Down
1 change: 1 addition & 0 deletions src/ast/ast_evaluator.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
#include <luisa/ast/function.h>
#include <luisa/ast/ast_evaluator.h>
#include <luisa/ast/type_registry.h>
Expand Down
1 change: 1 addition & 0 deletions src/ast/atomic_ref_node.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 4/6/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/ast/constant_data.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike Smith on 2021/3/6.
//
Expand Down
2 changes: 2 additions & 0 deletions src/ast/expression.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike Smith on 2021/3/13.
//
Expand Down Expand Up @@ -63,6 +64,7 @@ void CallExpr::_mark() const noexcept {
case CallOp::ATOMIC_FETCH_MIN:
case CallOp::ATOMIC_FETCH_MAX:
case CallOp::INDIRECT_CLEAR_DISPATCH_BUFFER:
case CallOp::INDIRECT_SET_DISPATCH_KERNEL:
case CallOp::INDIRECT_EMPLACE_DISPATCH_KERNEL:
_arguments[0]->mark(Usage::WRITE);
for (auto i = 1u; i < _arguments.size(); i++) {
Expand Down
1 change: 1 addition & 0 deletions src/ast/external_function.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 5/29/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/ast/function.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
//
// Created by Mike Smith on 2021/2/23.
Expand Down
1 change: 1 addition & 0 deletions src/ast/function_builder.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike Smith on 2020/12/2.
//
Expand Down
1 change: 1 addition & 0 deletions src/ast/op.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike Smith on 2021/8/6.
//
Expand Down
10 changes: 10 additions & 0 deletions src/ast/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once
#include <luisa/core/logging.h>
#include <luisa/core/basic_traits.h>
#include <luisa/core/basic_types.h>
#include <luisa/core/concepts.h>
#include <luisa/core/magic_enum.h>
#include <luisa/core/stl/vector.h>
#include <luisa/core/stl/unordered_map.h>
#include <luisa/core/stl/string.h>
#include <luisa/core/stl/filesystem.h>
1 change: 1 addition & 0 deletions src/ast/statement.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike Smith on 2021/11/1.
//
Expand Down
1 change: 1 addition & 0 deletions src/ast/type.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike Smith on 2021/2/6.
//
Expand Down
1 change: 1 addition & 0 deletions src/ast/variable.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike Smith on 2022/12/19.
//
Expand Down
1 change: 1 addition & 0 deletions src/ast/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ _config_project({
})
add_deps("lc-core", "lc-vstl")
add_headerfiles("../../include/luisa/ast/**.h")
set_pcxxheader("pch.h")
add_files("**.cpp")
add_cxflags("/bigobj", {
tools = "cl"
Expand Down
6 changes: 1 addition & 5 deletions src/backends/common/command_reorder_visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,7 @@ class CommandReorderVisitor : public CommandVisitor {
_cmd_lists.clear();
_arena.clear();
}
~CommandReorderVisitor() noexcept {
for (auto &&i : _res_map) {
vstd::destruct(i.second);
}
}
~CommandReorderVisitor() noexcept {}
[[nodiscard]] auto command_lists() const noexcept {
return luisa::span{_cmd_lists};
}
Expand Down
13 changes: 5 additions & 8 deletions src/backends/common/hlsl/builtin/indirect
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#define _LC_IndirectKernelDispatch uint
#define _LC_IndirectDispatchBuffer RWStructuredBuffer<uint>
void _ClearDispInd(RWStructuredBuffer<uint> buffer){buffer[0]=0;}
void _EmplaceDispInd3D(RWStructuredBuffer<uint> buffer,uint3 blk,uint3 size,uint kid){
uint idx;
void _SetDispInd(RWStructuredBuffer<uint> buffer,uint idx,uint3 blk,uint3 size,uint kid){
uint3 dispSize=(size+blk-1)/blk;
InterlockedAdd(buffer[0],1,idx);
idx=idx*7+1;
buffer[idx]=size.x;
buffer[idx+1]=size.y;
Expand All @@ -14,9 +12,8 @@ buffer[idx+4]=dispSize.x;
buffer[idx+5]=dispSize.y;
buffer[idx+6]=dispSize.z;
}
void _EmplaceDispInd2D(RWStructuredBuffer<uint> buffer,uint2 blk,uint2 size,uint kid){
_EmplaceDispInd3D(buffer,uint3(blk,1),uint3(size,1),kid);
}
void _EmplaceDispInd1D(RWStructuredBuffer<uint> buffer,uint blk,uint size,uint kid){
_EmplaceDispInd3D(buffer,uint3(blk,1,1),uint3(size,1,1),kid);
void _EmplaceDispInd(RWStructuredBuffer<uint> buffer,uint3 blk,uint3 size,uint kid){
uint idx;
InterlockedAdd(buffer[0],1,idx);
_SetDispInd(buffer,idx,blk,size,kid);
}
4 changes: 2 additions & 2 deletions src/backends/common/hlsl/builtin/indirect.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "hlsl_config.h"
LC_HLSL_EXTERN char indirect[]={35,100,101,102,105,110,101,32,95,76,67,95,73,110,100,105,114,101,99,116,75,101,114,110,101,108,68,105,115,112,97,116,99,104,32,117,105,110,116,10,35,100,101,102,105,110,101,32,95,76,67,95,73,110,100,105,114,101,99,116,68,105,115,112,97,116,99,104,66,117,102,102,101,114,32,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,10,118,111,105,100,32,95,67,108,101,97,114,68,105,115,112,73,110,100,40,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,32,98,117,102,102,101,114,41,123,98,117,102,102,101,114,91,48,93,61,48,59,125,10,118,111,105,100,32,95,69,109,112,108,97,99,101,68,105,115,112,73,110,100,51,68,40,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,32,98,117,102,102,101,114,44,117,105,110,116,51,32,98,108,107,44,117,105,110,116,51,32,115,105,122,101,44,117,105,110,116,32,107,105,100,41,123,10,117,105,110,116,32,105,100,120,59,10,117,105,110,116,51,32,100,105,115,112,83,105,122,101,61,40,115,105,122,101,43,98,108,107,45,49,41,47,98,108,107,59,10,73,110,116,101,114,108,111,99,107,101,100,65,100,100,40,98,117,102,102,101,114,91,48,93,44,49,44,105,100,120,41,59,10,105,100,120,61,105,100,120,42,55,43,49,59,10,98,117,102,102,101,114,91,105,100,120,93,61,115,105,122,101,46,120,59,10,98,117,102,102,101,114,91,105,100,120,43,49,93,61,115,105,122,101,46,121,59,10,98,117,102,102,101,114,91,105,100,120,43,50,93,61,115,105,122,101,46,122,59,10,98,117,102,102,101,114,91,105,100,120,43,51,93,61,107,105,100,59,10,98,117,102,102,101,114,91,105,100,120,43,52,93,61,100,105,115,112,83,105,122,101,46,120,59,10,98,117,102,102,101,114,91,105,100,120,43,53,93,61,100,105,115,112,83,105,122,101,46,121,59,10,98,117,102,102,101,114,91,105,100,120,43,54,93,61,100,105,115,112,83,105,122,101,46,122,59,10,125,10,118,111,105,100,32,95,69,109,112,108,97,99,101,68,105,115,112,73,110,100,50,68,40,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,32,98,117,102,102,101,114,44,117,105,110,116,50,32,98,108,107,44,117,105,110,116,50,32,115,105,122,101,44,117,105,110,116,32,107,105,100,41,123,10,95,69,109,112,108,97,99,101,68,105,115,112,73,110,100,51,68,40,98,117,102,102,101,114,44,117,105,110,116,51,40,98,108,107,44,49,41,44,117,105,110,116,51,40,115,105,122,101,44,49,41,44,107,105,100,41,59,10,125,10,118,111,105,100,32,95,69,109,112,108,97,99,101,68,105,115,112,73,110,100,49,68,40,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,32,98,117,102,102,101,114,44,117,105,110,116,32,98,108,107,44,117,105,110,116,32,115,105,122,101,44,117,105,110,116,32,107,105,100,41,123,10,95,69,109,112,108,97,99,101,68,105,115,112,73,110,100,51,68,40,98,117,102,102,101,114,44,117,105,110,116,51,40,98,108,107,44,49,44,49,41,44,117,105,110,116,51,40,115,105,122,101,44,49,44,49,41,44,107,105,100,41,59,10,125,10};
LC_HLSL_EXTERN char indirect[]={35,100,101,102,105,110,101,32,95,76,67,95,73,110,100,105,114,101,99,116,75,101,114,110,101,108,68,105,115,112,97,116,99,104,32,117,105,110,116,10,35,100,101,102,105,110,101,32,95,76,67,95,73,110,100,105,114,101,99,116,68,105,115,112,97,116,99,104,66,117,102,102,101,114,32,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,10,118,111,105,100,32,95,67,108,101,97,114,68,105,115,112,73,110,100,40,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,32,98,117,102,102,101,114,41,123,98,117,102,102,101,114,91,48,93,61,48,59,125,10,118,111,105,100,32,95,83,101,116,68,105,115,112,73,110,100,40,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,32,98,117,102,102,101,114,44,117,105,110,116,32,105,100,120,44,117,105,110,116,51,32,98,108,107,44,117,105,110,116,51,32,115,105,122,101,44,117,105,110,116,32,107,105,100,41,123,10,117,105,110,116,51,32,100,105,115,112,83,105,122,101,61,40,115,105,122,101,43,98,108,107,45,49,41,47,98,108,107,59,10,105,100,120,61,105,100,120,42,55,43,49,59,10,98,117,102,102,101,114,91,105,100,120,93,61,115,105,122,101,46,120,59,10,98,117,102,102,101,114,91,105,100,120,43,49,93,61,115,105,122,101,46,121,59,10,98,117,102,102,101,114,91,105,100,120,43,50,93,61,115,105,122,101,46,122,59,10,98,117,102,102,101,114,91,105,100,120,43,51,93,61,107,105,100,59,10,98,117,102,102,101,114,91,105,100,120,43,52,93,61,100,105,115,112,83,105,122,101,46,120,59,10,98,117,102,102,101,114,91,105,100,120,43,53,93,61,100,105,115,112,83,105,122,101,46,121,59,10,98,117,102,102,101,114,91,105,100,120,43,54,93,61,100,105,115,112,83,105,122,101,46,122,59,10,125,10,118,111,105,100,32,95,69,109,112,108,97,99,101,68,105,115,112,73,110,100,40,82,87,83,116,114,117,99,116,117,114,101,100,66,117,102,102,101,114,60,117,105,110,116,62,32,98,117,102,102,101,114,44,117,105,110,116,51,32,98,108,107,44,117,105,110,116,51,32,115,105,122,101,44,117,105,110,116,32,107,105,100,41,123,10,117,105,110,116,32,105,100,120,59,10,73,110,116,101,114,108,111,99,107,101,100,65,100,100,40,98,117,102,102,101,114,91,48,93,44,49,44,105,100,120,41,59,10,95,83,101,116,68,105,115,112,73,110,100,40,98,117,102,102,101,114,44,105,100,120,44,98,108,107,44,115,105,122,101,44,107,105,100,41,59,10,125,10};
LC_HLSL_EXTERN char *get_indirect(){return indirect;}
LC_HLSL_EXTERN int get_indirect_size(){return 801;}
LC_HLSL_EXTERN int get_indirect_size(){return 633;}
15 changes: 6 additions & 9 deletions src/backends/common/hlsl/hlsl_codegen_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static size_t AddHeader(CallOpSet const &ops, luisa::BinaryIO const *internalDat
if (ops.test(CallOp::INVERSE)) {
builder << CodegenUtility::ReadInternalHLSLFile("inverse", internalDataPath);
}
if (ops.test(CallOp::INDIRECT_CLEAR_DISPATCH_BUFFER) || ops.test(CallOp::INDIRECT_EMPLACE_DISPATCH_KERNEL)) {
if (ops.test(CallOp::INDIRECT_CLEAR_DISPATCH_BUFFER) || ops.test(CallOp::INDIRECT_EMPLACE_DISPATCH_KERNEL) || ops.test(CallOp::INDIRECT_SET_DISPATCH_KERNEL)) {
builder << CodegenUtility::ReadInternalHLSLFile("indirect", internalDataPath);
}
if (ops.test(CallOp::BUFFER_SIZE) || ops.test(CallOp::TEXTURE_SIZE)) {
Expand Down Expand Up @@ -947,14 +947,11 @@ void CodegenUtility::GetFunctionName(CallExpr const *expr, vstd::StringBuilder &
break;
case CallOp::INDIRECT_EMPLACE_DISPATCH_KERNEL: {
LUISA_ASSERT(!opt->isRaster, "indirect-operation can only be used in compute shader");
auto tp = args[1]->type();
if (tp->is_scalar()) {
str << "_EmplaceDispInd1D"sv;
} else if (tp->dimension() == 2) {
str << "_EmplaceDispInd2D"sv;
} else {
str << "_EmplaceDispInd3D"sv;
}
str << "_EmplaceDispInd"sv;
} break;
case CallOp::INDIRECT_SET_DISPATCH_KERNEL: {
LUISA_ASSERT(!opt->isRaster, "indirect-operation can only be used in compute shader");
str << "_SetDispInd"sv;
} break;
case CallOp::RAY_QUERY_WORLD_SPACE_RAY:
str << "_RayQueryGetWorldRay<"sv;
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_accel.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 2021/12/2.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_bindless_array.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 7/30/2021.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 3/14/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_builtin_embedded.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"

extern "C" const char luisa_cuda_builtin_cuda_builtin_kernels[5490] = {
0x2f, 0x2f, 0x0d, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62,
Expand Down
2 changes: 2 additions & 0 deletions src/backends/cuda/cuda_codegen_ast.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 2021/11/8.
//
Expand Down Expand Up @@ -944,6 +945,7 @@ void CUDACodegenAST::visit(const CallExpr *expr) {
case CallOp::RASTER_DISCARD: LUISA_ERROR_WITH_LOCATION("Not implemented."); break;
case CallOp::INDIRECT_CLEAR_DISPATCH_BUFFER: _scratch << "lc_indirect_buffer_clear"; break;
case CallOp::INDIRECT_EMPLACE_DISPATCH_KERNEL: _scratch << "lc_indirect_buffer_emplace"; break;
case CallOp::INDIRECT_SET_DISPATCH_KERNEL: LUISA_ERROR_WITH_LOCATION("Not implemented."); break;
case CallOp::DDX: LUISA_ERROR_WITH_LOCATION("Not implemented."); break;
case CallOp::DDY: LUISA_ERROR_WITH_LOCATION("Not implemented."); break;
}
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_command_encoder.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 8/1/2021.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_compiler.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 2021/11/8.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_device.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 7/28/2021.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_dstorage.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 5/26/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_event.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 7/2/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_ext.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Hercier on 2023/4/6.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_host_buffer_pool.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 8/1/2021.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_mesh.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 2021/12/2.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_primitive.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 4/1/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_procedural_primitive.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 3/27/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_shader.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 4/4/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_shader_metadata.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 4/4/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_shader_native.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 3/18/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_shader_optix.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 3/18/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_stream.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 8/1/2021.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_swapchain.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 3/24/2023.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/cuda_texture.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
//
// Created by Mike on 2021/11/6.
//
Expand Down
1 change: 1 addition & 0 deletions src/backends/cuda/optix_api.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "pch.h"
#include "optix_api.h"
#include <luisa/core/logging.h>
#include <luisa/core/platform.h>
Expand Down
15 changes: 15 additions & 0 deletions src/backends/cuda/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once
#include <luisa/core/logging.h>
#include <luisa/core/basic_traits.h>
#include <luisa/core/basic_types.h>
#include <luisa/core/concepts.h>
#include <luisa/core/magic_enum.h>
#include <luisa/core/stl/vector.h>
#include <luisa/core/stl/unordered_map.h>
#include <luisa/core/stl/string.h>
#include <luisa/core/stl/filesystem.h>
#include <luisa/runtime/buffer.h>
#include <luisa/runtime/image.h>
#include <luisa/runtime/shader.h>
#include <luisa/runtime/dispatch_buffer.h>
#include "cuda.h"
1 change: 1 addition & 0 deletions src/backends/cuda/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ add_deps("lc-runtime")
if get_config("enable_ir") then
add_deps("lc-ir")
end
set_pcxxheader("pch.h")
add_headerfiles("**.h", "../common/default_binary_io.h", "../common/string_scratch.h")
add_files("**.cpp", "../common/default_binary_io.cpp", "../common/string_scratch.cpp")
on_load(function(target)
Expand Down
1 change: 1 addition & 0 deletions src/backends/dx/DXApi/LCCmdBuffer.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "../pch.h"
#include <DXApi/LCCmdBuffer.h>
#include <DXApi/LCDevice.h>
#include <luisa/runtime/rhi/command.h>
Expand Down
1 change: 1 addition & 0 deletions src/backends/dx/DXApi/LCDevice.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "../pch.h"
#include <filesystem>
#include <DXApi/LCDevice.h>
#include <DXRuntime/Device.h>
Expand Down
1 change: 1 addition & 0 deletions src/backends/dx/DXApi/LCEvent.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "../pch.h"

#include <DXApi/LCEvent.h>
#include <DXRuntime/CommandQueue.h>
Expand Down
1 change: 1 addition & 0 deletions src/backends/dx/DXApi/LCSwapChain.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "../pch.h"
#include <DXApi/LCSwapChain.h>
#include <dxgi1_2.h>
#include <DXRuntime/Device.h>
Expand Down
1 change: 1 addition & 0 deletions src/backends/dx/DXApi/cuda_interop.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "../pch.h"
#include "ext.h"
#ifdef LCDX_ENABLE_CUDA
#include <cuda.h>
Expand Down
1 change: 1 addition & 0 deletions src/backends/dx/DXApi/dml_ext.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "../pch.h"
#include "dml_ext.h"
#include "LCCmdBuffer.h"
#include <luisa/runtime/stream.h>
Expand Down
1 change: 1 addition & 0 deletions src/backends/dx/DXApi/ext.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "../pch.h"
#include "ext.h"
#include <DXApi/LCDevice.h>
#include <DXRuntime/Device.h>
Expand Down
1 change: 1 addition & 0 deletions src/backends/dx/DXRuntime/CommandAllocator.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "../pch.h"
#include <DXRuntime/CommandAllocator.h>
#include <DXRuntime/CommandQueue.h>
namespace lc::dx {
Expand Down
Loading

0 comments on commit 2ca4e80

Please sign in to comment.