|
3 | 3 | #include "simsycl/detail/check.hh" |
4 | 4 | #include "simsycl/sycl/device.hh" |
5 | 5 | #include "simsycl/sycl/platform.hh" |
6 | | -#include "simsycl/templates.hh" |
7 | 6 |
|
8 | 7 | #include <assert.h> |
9 | 8 | #include <limits> |
@@ -133,14 +132,7 @@ struct system_state { |
133 | 132 | std::optional<system_state> system; |
134 | 133 |
|
135 | 134 | system_state &get_system() { |
136 | | - if(!detail::system.has_value()) { |
137 | | - system_config config; |
138 | | - config.platforms.emplace("CUDA", simsycl::templates::platform::cuda_12_2); |
139 | | - for(int i = 0; i < 4; ++i) { |
140 | | - config.devices.emplace("GPU#" + std::to_string(i), simsycl::templates::device::nvidia::rtx_3090); |
141 | | - } |
142 | | - configure_system(config); |
143 | | - } |
| 135 | + if(!system.has_value()) { system.emplace(default_system); } |
144 | 136 | return system.value(); |
145 | 137 | } |
146 | 138 |
|
@@ -267,4 +259,106 @@ namespace simsycl { |
267 | 259 |
|
268 | 260 | void configure_system(const system_config &system) { detail::system.emplace(system); } |
269 | 261 |
|
| 262 | +const platform_config default_platform{ |
| 263 | + .version = "0.1", |
| 264 | + .name = "SimSYCL", |
| 265 | + .vendor = "SimSYCL", |
| 266 | + .extensions = {}, |
| 267 | +}; |
| 268 | + |
| 269 | +const device_config default_device{ |
| 270 | + .device_type = sycl::info::device_type::gpu, |
| 271 | + .vendor_id = 0, |
| 272 | + .max_compute_units = 16, |
| 273 | + .max_work_item_dimensions = 3, |
| 274 | + .max_work_item_sizes_1 = {1024}, |
| 275 | + .max_work_item_sizes_2 = {1024, 1024}, |
| 276 | + .max_work_item_sizes_3 = {64, 1024, 1024}, |
| 277 | + .max_work_group_size = 1024, |
| 278 | + .max_num_sub_groups = 32, |
| 279 | + .sub_group_sizes = {32}, |
| 280 | + .preferred_vector_width_char = 4, |
| 281 | + .preferred_vector_width_short = 2, |
| 282 | + .preferred_vector_width_int = 1, |
| 283 | + .preferred_vector_width_long = 1, |
| 284 | + .preferred_vector_width_float = 1, |
| 285 | + .preferred_vector_width_double = 1, |
| 286 | + .preferred_vector_width_half = 2, |
| 287 | + .native_vector_width_char = 4, |
| 288 | + .native_vector_width_short = 2, |
| 289 | + .native_vector_width_int = 1, |
| 290 | + .native_vector_width_long = 1, |
| 291 | + .native_vector_width_float = 1, |
| 292 | + .native_vector_width_double = 1, |
| 293 | + .native_vector_width_half = 2, |
| 294 | + .max_clock_frequency = 1000, |
| 295 | + .address_bits = 64, |
| 296 | + .max_mem_alloc_size = std::numeric_limits<std::size_t>::max(), |
| 297 | + .image_support = false, |
| 298 | + .max_read_image_args = 0, |
| 299 | + .max_write_image_args = 0, |
| 300 | + .image2d_max_height = 0, |
| 301 | + .image2d_max_width = 0, |
| 302 | + .image3d_max_height = 0, |
| 303 | + .image3d_max_width = 0, |
| 304 | + .image3d_max_depth = 0, |
| 305 | + .image_max_buffer_size = 0, |
| 306 | + .max_samplers = 0, |
| 307 | + .max_parameter_size = std::numeric_limits<std::size_t>::max(), |
| 308 | + .mem_base_addr_align = 8, |
| 309 | + .half_fp_config |
| 310 | + = {sycl::info::fp_config::denorm, sycl::info::fp_config::inf_nan, sycl::info::fp_config::round_to_nearest, |
| 311 | + sycl::info::fp_config::round_to_zero, sycl::info::fp_config::round_to_inf, sycl::info::fp_config::fma, |
| 312 | + sycl::info::fp_config::correctly_rounded_divide_sqrt}, |
| 313 | + .single_fp_config |
| 314 | + = {sycl::info::fp_config::denorm, sycl::info::fp_config::inf_nan, sycl::info::fp_config::round_to_nearest, |
| 315 | + sycl::info::fp_config::round_to_zero, sycl::info::fp_config::round_to_inf, sycl::info::fp_config::fma, |
| 316 | + sycl::info::fp_config::correctly_rounded_divide_sqrt}, |
| 317 | + .double_fp_config |
| 318 | + = {sycl::info::fp_config::denorm, sycl::info::fp_config::inf_nan, sycl::info::fp_config::round_to_nearest, |
| 319 | + sycl::info::fp_config::round_to_zero, sycl::info::fp_config::round_to_inf, sycl::info::fp_config::fma, |
| 320 | + sycl::info::fp_config::correctly_rounded_divide_sqrt}, |
| 321 | + .global_mem_cache_type = sycl::info::global_mem_cache_type::read_write, |
| 322 | + .global_mem_cache_line_size = 128, |
| 323 | + .global_mem_cache_size = 16 << 20, |
| 324 | + .global_mem_size = std::numeric_limits<std::size_t>::max(), |
| 325 | + .max_constant_buffer_size = 1 << 16, |
| 326 | + .max_constant_args = std::numeric_limits<uint32_t>::max(), |
| 327 | + .local_mem_type = sycl::info::local_mem_type::local, |
| 328 | + .local_mem_size = 64 << 10, |
| 329 | + .error_correction_support = false, |
| 330 | + .host_unified_memory = false, |
| 331 | + .profiling_timer_resolution = 1, |
| 332 | + .is_endian_little = true, |
| 333 | + .is_available = true, |
| 334 | + .is_compiler_available = true, |
| 335 | + .is_linker_available = true, |
| 336 | + .execution_capabilities = {sycl::info::execution_capability::exec_kernel}, |
| 337 | + .queue_profiling = true, |
| 338 | + .built_in_kernels = {}, |
| 339 | + .platform_id = "SimSYCL", |
| 340 | + .name = "SimSYCL virtual GPU", |
| 341 | + .vendor = "SimSYCL", |
| 342 | + .driver_version = "0.1", |
| 343 | + .profile = "FULL_PROFILE", |
| 344 | + .version = "0.1", |
| 345 | + .aspects |
| 346 | + = { sycl::aspect::gpu, sycl::aspect::accelerator, sycl::aspect::fp64, sycl::aspect::atomic64, |
| 347 | + sycl::aspect::queue_profiling, sycl::aspect::usm_device_allocations, sycl::aspect::usm_host_allocations, |
| 348 | + sycl::aspect::usm_shared_allocations, }, |
| 349 | + .extensions = {}, |
| 350 | + .printf_buffer_size = std::numeric_limits<std::size_t>::max(), |
| 351 | + .preferred_interop_user_sync = true, |
| 352 | + .partition_max_sub_devices = 0, |
| 353 | + .partition_properties = {}, |
| 354 | + .partition_affinity_domains = {sycl::info::partition_affinity_domain::not_applicable}, |
| 355 | + .partition_type_property = sycl::info::partition_property::no_partition, |
| 356 | + .partition_type_affinity_domain = sycl::info::partition_affinity_domain::not_applicable, |
| 357 | +}; |
| 358 | + |
| 359 | +const system_config default_system{ |
| 360 | + .platforms = {{"SimSYCL", default_platform}}, |
| 361 | + .devices = {{"GPU", default_device}}, |
| 362 | +}; |
| 363 | + |
270 | 364 | } // namespace simsycl |
0 commit comments