Skip to content

Commit bb2f42a

Browse files
wip: support no-eastl
1 parent 0bf10f7 commit bb2f42a

File tree

7 files changed

+35
-24
lines changed

7 files changed

+35
-24
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
os: [ ubuntu-24.04, ubuntu-24.04-arm, ubuntu-22.04 ]
10+
include:
11+
- os: ubuntu-24.04
12+
arch: x86_64
13+
cuda-keyring: x86_64
14+
- os: ubuntu-24.04-arm
15+
arch: aarch64
16+
cuda-keyring: sbsa
1117
compiler:
1218
- { name: gcc, version: 11 }
13-
# - { name: gcc, version: 12 }
1419
- { name: gcc, version: 13 }
1520
- { name: clang, version: 14 }
1621
- { name: clang, version: 15 }
@@ -40,23 +45,15 @@ jobs:
4045
fi
4146
sudo apt-get update
4247
sudo apt-get -y install build-essential cmake ninja-build uuid-dev libxinerama-dev libxcursor-dev libxi-dev libvulkan-dev libxkbcommon-dev libxrandr-dev
43-
- name: "Download CUDA Keyring (ubuntu-24.04)"
44-
if: matrix.os == 'ubuntu-24.04'
48+
- name: "Install CUDA Keyring"
4549
run: |
46-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
47-
- name: "Download CUDA Keyring (ubuntu-24.04-arm)"
48-
if: matrix.os == 'ubuntu-24.04-arm'
49-
run: |
50-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/sbsa/cuda-keyring_1.1-1_all.deb
51-
- name: "Download CUDA Keyring (ubuntu-22.04)"
52-
if: matrix.os == 'ubuntu-22.04'
53-
run: |
54-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
50+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/${{ matrix.cuda-keyring }}/cuda-keyring_1.1-1_all.deb
51+
sudo apt-get -y remove --purge -s '*cuda*' '*nvidia*'
52+
sudo dpkg -i cuda-keyring_1.1-1_all.deb
5553
- name: "Setup CUDA"
5654
run: |
57-
sudo dpkg -i cuda-keyring_1.1-1_all.deb
5855
sudo apt-get update
59-
sudo apt-get -y install cuda-12.8
56+
sudo apt-get -y install cuda
6057
sudo apt-get -y clean # save some space
6158
- name: "Setup Vulkan SDK"
6259
uses: johnnynunez/setup-vulkan-sdk@v1

src/compute

src/sdl/scene_node_desc.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,28 @@ namespace luisa::render {
1717
class SceneDesc;
1818
class SceneNodeDesc;
1919

20+
struct JustBool {
21+
bool value;
22+
JustBool(bool value) noexcept : value{value} {}
23+
operator bool() const noexcept { return value; }
24+
};
25+
2026
namespace detail {
2127

2228
template<typename T>
23-
struct scene_node_raw_property : public scene_node_raw_property<std::remove_cvref<T>> {};
29+
struct scene_node_raw_property
30+
: public scene_node_raw_property<std::remove_cvref<T>> {};
31+
32+
// use JustBool to represent bool to avoid vector<bool> specialization
33+
template<>
34+
struct scene_node_raw_property<JustBool> {
35+
using type = JustBool;
36+
static constexpr luisa::string_view value = "bool";
37+
};
2438

2539
template<>
2640
struct scene_node_raw_property<bool> {
27-
using type = bool;
41+
using type = JustBool;
2842
static constexpr luisa::string_view value = "bool";
2943
};
3044

@@ -81,7 +95,7 @@ constexpr auto is_property_list_v<luisa::vector<T>> = true;
8195
class SceneNodeDesc {
8296

8397
public:
84-
using bool_type = bool;
98+
using bool_type = JustBool;
8599
using number_type = double;
86100
using string_type = luisa::string;
87101
using node_type = const SceneNodeDesc *;
@@ -296,7 +310,7 @@ SceneNodeDesc::_property_raw_values(luisa::string_view name) const noexcept {
296310
_identifier, source_location().string());
297311
return luisa::nullopt;
298312
}
299-
return luisa::span{std::as_const(*ptr)};
313+
return luisa::span{*std::as_const(ptr)};
300314
}
301315

302316
template<typename T>

src/sdl/scene_parser_json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void SceneParserJSON::_parse_node(SceneNodeDesc &desc, const json &node) const n
9999
for (auto &&v : array) { values.emplace_back(v.get<double>()); }
100100
desc.add_property(item.key(), std::move(values));
101101
} else if (array[0].is_boolean()) {
102-
luisa::vector<bool> values;
102+
luisa::vector<JustBool> values;
103103
values.reserve(array.size());
104104
for (auto &&v : array) { values.emplace_back(v.get<bool>()); }
105105
desc.add_property(item.key(), std::move(values));

src/surfaces/glass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ inline auto builtin_ior_texture_desc(luisa::string name) noexcept {
2222
desc->define(SceneNodeTag::TEXTURE, "Constant", {});
2323
desc->add_property("v", SceneNodeDesc::number_list{ior.x, ior.y, ior.z});
2424
for (auto &c : name) { c = static_cast<char>(tolower(c)); }
25-
return eastl::make_pair(std::move(name), std::move(desc));
25+
return luisa::make_pair(std::move(name), std::move(desc));
2626
};
2727
using namespace std::string_view_literals;
2828
return luisa::fixed_map<luisa::string, luisa::shared_ptr<SceneNodeDesc>, 15>{

src/util/polymorphic_closure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class PolymorphicCall {
6868
const ClosureCreator &f = [] { return luisa::make_unique<Closure>(); }) noexcept {
6969

7070
auto [iter, first] = _closure_tags.try_emplace(
71-
identifier, static_cast<uint>(_closures.size()));
71+
luisa::string{identifier}, static_cast<uint>(_closures.size()));
7272
if (first) { _closures.emplace_back(f()); }
7373
_tag = iter->second;
7474
auto closure = dynamic_cast<T *>(_closures[iter->second].get());

src/util/sampling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ create_alias_table(luisa::span<const float> values) noexcept {
4646
} else [[likely]] {
4747
auto inv_sum = 1.0 / sum;
4848
std::transform(
49-
values.cbegin(), values.cend(), pdf.begin(),
49+
values.begin(), values.end(), pdf.begin(),
5050
[inv_sum](auto v) noexcept {
5151
return static_cast<float>(std::abs(v) * inv_sum);
5252
});

0 commit comments

Comments
 (0)