Skip to content

Commit 4124419

Browse files
committed
Pinpoint reason for the multithreading crash
- cut-and-pasted whole source code from RayTracingWeekend.jl - crash doesn't occur then - Commented out redefinitions that make no difference on the crash - The problems seems related to the initialization of `TRNG` and its use in related functions, and my aggressive use of @inline... - search for `claforte CRASH` for my debugging notes
1 parent 6b53e54 commit 4124419

File tree

4 files changed

+558
-15
lines changed

4 files changed

+558
-15
lines changed

src/RayTracingWeekend.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ using Images, LinearAlgebra, Random, RandomNumbers.Xorshifts, StaticArrays
44

55
export color_vec3_in_rgb, default_camera, get_ray, hit, near_zero, point, random_between, random_vec2,
66
random_vec2_in_disk, random_vec3, random_vec3_in_sphere, random_vec3_on_sphere, ray_color, ray_to_HitRecord, reflect,
7-
reflectance, refract, render, reseed!, rgb, rgb_gamma2, skycolor, squared_length, trand
7+
reflectance, refract, render, reseed!, rgb, rgb_gamma2, scatter, skycolor, squared_length, trand
88
export Camera, Dielectric, Hittable, HittableList, HitRecord, Lambertian, Material, Metal, Ray, Scatter, Sphere, Vec3
99
export scene_2_spheres, scene_4_spheres, scene_blue_red_spheres, scene_diel_spheres, scene_random_spheres
1010

11+
export TRNG
12+
1113
const Vec3{T<:AbstractFloat} = SVector{3, T}
1214

1315
# Adapted from @Christ_Foster's: https://discourse.julialang.org/t/ray-tracing-in-a-week-end-julia-vs-simd-optimized-c/72958/40

src/old_proto.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using BenchmarkTools, Images, InteractiveUtils, LinearAlgebra, StaticArrays
66
using LoopVectorization: @turbo
7-
using SIMD: @simd
7+
#using SIMD: @simd
88

99
Threads.nthreads()
1010

0 commit comments

Comments
 (0)