Comments (4)
If instead ...
Does it have to be "instead"? I mean what prevents us from just adding it? Not that I have some attachment to From, it's just that yanking it is likely to be considered bad style. You kind of add something new and remove old later...
If I should provide a pull request, let me know.
If it's just Display, I can handle it. But maybe there is more to it. Say it might be appropriate to implement Error trait. In other words if you can think of something more nuanced than adding Display, then a pull request would be appreciated. Well, it would be appreciated in either case, but we do need our Rust exercises too, you know :-)
from sppark.
Does it have to be "instead"? I mean what prevents us from just adding it?
You're right. Display could just be added, you can keep the From<Error> for String
implementation.
If it's just Display, I can handle it. But maybe there is more to it.
Indeed the "proper" way would be to also implement the Error
trait.
Well, it would be appreciated in either case, but we do need our Rust exercises too, you know :-)
Then I'd take a look at https://crates.io/crates/thiserror. This is a simple macro that generates the code you'd otherwise create manually. This would then also implement Dsiplay
.
One thing I don't fully understand is, why the CUDA error is wrappen in a macro. Why not just having it as a normal struct and importing it whenever you want to use it?
from sppark.
I've added Display, simplified for now as Error needs an overhaul. Because we've discussed using it for conveying errors other than CUDA.
One thing I don't fully understand is, why the CUDA error is wrappen in a macro.
The original rationale was that we don't know if it will be needed (because target application might not be using CUDA code), and providing a macro would give the application freedom to decide. But since it's discussed to be used for other errors, it's arguably appropriate to change that...
from sppark.
Thanks a lot for implementing Display
, it's kind of nicer to be able to call .to_string()
.
from sppark.
Related Issues (20)
- WebGPU support HOT 1
- Upcoming error in rust crate HOT 2
- sppark/ff/mont_t.cuh(721): error: identifier "i" is undefined HOT 3
- vec256 type declaration HOT 7
- pasta_curve parameters HOT 1
- missing headers in `ff` module HOT 1
- missing definition of basic types HOT 1
- Race condition in msm/sort.cuh HOT 3
- how to understand the implementation of `reduce(uint32_t temp[4])` HOT 3
- Support halo2curves HOT 3
- gl64, the + result is incorrect when both operands > p HOT 1
- Compilation error (observed from pasta-msm) HOT 9
- what is the definition of `const uint32_t& M0` in mont_t.cuh HOT 1
- failed to run custom build command for `sppark v0.1.5' HOT 1
- data copy time fluctuating while concurrent NTT invokation HOT 1
- fork safety issue HOT 7
- A question about Montgomery mult (form ff/mont_t.cuh) HOT 1
- Trying to combine MSM and NTT into single kernel HOT 5
- NTT curve support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sppark.