File indexing completed on 2026-06-26 07:50:05
0001 #pragma once
0002
0003 #include <filesystem>
0004 #include <string>
0005 #include <vector>
0006
0007 #include "torch.h"
0008
0009 namespace gphox
0010 {
0011
0012 enum class EventMode
0013 {
0014 DebugHeavy,
0015 DebugLite,
0016 Nothing,
0017 Minimal,
0018 Hit,
0019 HitPhoton,
0020 HitPhotonSeq,
0021 HitSeq
0022 };
0023
0024 enum class ModeLite : int
0025 {
0026
0027 Unspecified = -1,
0028
0029
0030 Standard = 0,
0031
0032
0033 Lite = 1,
0034
0035
0036 DebugCompare = 2
0037 };
0038
0039 enum class ModeMerge : int
0040 {
0041
0042 Unspecified = -1,
0043
0044
0045 Separate = 0,
0046
0047
0048 Merged = 1
0049 };
0050
0051
0052
0053
0054
0055
0056
0057
0058 class Config
0059 {
0060 public:
0061 Config(std::string config_name = "dev");
0062
0063 static std::string PtxPath(const std::string& ptx_name = "CSGOptiX7.ptx");
0064
0065
0066 std::string name{"dev"};
0067
0068
0069 int max_bounce{31};
0070
0071
0072 int max_genstep{10000000};
0073
0074
0075 int maxslot{0};
0076
0077
0078 EventMode event_mode{EventMode::Minimal};
0079
0080
0081 ModeLite mode_lite{ModeLite::Unspecified};
0082
0083
0084 ModeMerge mode_merge{ModeMerge::Unspecified};
0085
0086
0087 std::filesystem::path output_dir{std::filesystem::current_path()};
0088
0089
0090 float propagate_epsilon{0.05f};
0091
0092
0093 float propagate_epsilon0{0.05f};
0094
0095
0096 std::string propagate_epsilon0_mask{"TO,CK,SI,SC,RE"};
0097
0098 storch torch{default_torch};
0099
0100 private:
0101 std::string Locate(std::string filename) const;
0102 void ReadConfig(std::string filepath);
0103 void Apply() const;
0104 };
0105
0106 }