8000 Fall back to architecture when pointer-size model is unavailable by RicheyWorks · Pull Request #55 · jcuda/jcuda · GitHub
[go: up one dir, main page]

Skip to content

Fall back to architecture when pointer-size model is unavailable - #55

Draft
RicheyWorks wants to merge 1 commit into
jcuda:masterfrom
RicheyWorks:fix/pointer-size-model-fallback
Draft

RicheyWorks wants to merge 1 commit into
jcuda:masterfrom
RicheyWorks:fix/pointer-size-model-fallback

Conversation

@RicheyWorks
Copy link
Copy Markdown

Sizeof.computePointerSize dereferences sun.arch.data.model without checking for null. If that implementation-specific property is absent, initializing Sizeof.POINTER throws ExceptionInInitializerError caused by NullPointerException. For an unrecognized value it also assumes 32 bits even when the architecture is a known 64-bit family.

Keep explicit 32/64 model values authoritative, use null-safe comparison, and fall back to the existing LibUtils.calculateArch() classification for known 32/64-bit architectures. Retain the historical warning and 32-bit assumption for unrecognized/ambiguous architectures when the model cannot decide.

Add 14 parameterized tests, each in a fresh child JVM so property overrides and Sizeof class initialization do not affect the test runner. Covers explicit-model precedence, missing models on x86/ARM/PowerPC/MIPS families, an unexpected model on amd64, and the unknown-architecture fallback. Baseline: 14 tests with 11 failures; fixed: 14 tests, zero failures/errors/skips under Maven/JUnit 4.13.1.

Validation host is Windows x86_64/Temurin 22, with the previously disclosed isolated parent source/target 8 adaptation because upstream's Java 7 target is rejected by this JDK. No POM, JNI, native-binary or GPU change. No CUDA libraries are loaded by these tests.

These are simulated property configurations, not execution on actual 32-bit/ARM/PowerPC/MIPS machines or verification of their native ABI/libraries. The unknown-architecture 32-bit fallback remains a limitation; this change does not add new platform binaries or claim support for new CUDA platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0