The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
That's why I've taken to checking out the NWS for my weather. Particularly for extreme weather.
No emotion. No need for ratings. No opinions - just probabilities.*
Then, too - why not hype it? Everyone seems to go and buy out the supermarkets whenever the sky determines it's time to phart. There has never been a food shortage that I can remember - except for Sandy - and that wasn't a real shortage since you couldn't stay in your home, anyway (and the food they bought was ruined).
Must be a need for millennials: they don't have good movies, music, or, with their face glued to their phone, a life. I guess they need something to be proud of.
Absolutely spot on! I wasted 10 minutes of my life yesterday trying to work out which one of the social face-ache / messaging systems had sent me a notification that I actually (for once) needed to read
Instead of just complaining about it, I set out to fix it. Although maybe "fix" is a big word for what I'm doing since I'm not building it into the language, just adding it on as a class library. As a result it does not mix with normal code well.
Here is an example of what it would look like:
SIMDcode s = new SIMDcode(_ =>
var ptr = _.arg(0);
var size = _.arg(1);
var constants = _.arg(2);
var w = _._mm_loadu_si128(constants, 0);
var shufmask = _._mm_loadu_si128(constants, 16);
var alpha = _._mm_loadu_si128(constants, 32);
var p = _._mm_load_si128(ptr, 0);
p = _._mm_maddubs_epi16(p, w);
p = _._mm_add_epi32(p, _._mm_srli_si128(p, 2));
p = _._mm_srli_epi32(p, 6);
p = _._mm_shuffle_epi8(p, shufmask);
p = _._mm_or_si128(p, alpha);
_._mm_store_si128(ptr, 0, p);
The "meat" looks just like "intrinsics" like you're used to (or not, if you've never worked with them), but in this case they're not proper intrinsic functions. When executed they build up some internal representation of the code, which is then compiled and written to unmanaged memory. That is also why it needs the "weird stuff" such as `arg` and `repeat` and `add_r_i` - normally normal code fills those rolls but here normal C# code will just execute once, it does not itself end up in the native code.
To actually invoke the code you define a delegate and ask for a function pointer of that type:
delegatevoid ToGrayDelegate(IntPtr pixels, int length, byte constants);
var f = s.GetDelegate<ToGrayDelegate>(0);
Just invoke that as normal. (this runs in 1 cycle per pixel on Haswell, the best I could do in pure C# was 6 cycles per pixel)
This is just a preview, and maybe that's all it will ever be. A bunch of things work, a lot of things do not work yet, because I just threw this whole together in a day.
Anyway I'm not sure how useful this actually is. On the one hand, you wouldn't need a separate C++ project that has to be kept in sync with the main project (but that's not even a real problem). On the other hand, it's more annoying to write code like in the example than to just write C++ with intrinsics. But this way the code can be tuned with run-time parameters (but is that even useful? and you can't do it too often since compiling more code obviously costs time). Theoretically this can easily support x86 and x64 simultaneously (that's a bit of a hassle with native dlls), but choosing one of them at compile time isn't really a problem anyway.
Compared to System.Numerics.Vectors I'd say this is a lot better - it actually allows you to get stuff done, there are all the usual things that you need such as shuffles and shifts and oddball instructions like vpmaddubsw. But compared to a C++ dll it doesn't seem all that useful.
So what do you think. Useful? Interesting? Total waste of time?
I second the opinion that an article on this would definetely be interesting, I am a user of SIMD and intrinsics and while I plan to use C# (if and when we will be able to spend the due time necessary to rewrite 60kloc in VB6 unto muche less C#) only for the GUI and leave the meat of elaborations and hardware and I/O processing in C++ I would definetely bookmark such a technique as it could prove useful in a number of situations.
* CALL APOGEE, SAY AARDWOLF
* GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
* Never pay more than 20 bucks for a computer game.
* I'm a puny punmaker.
Thought I would share this real world experience with some of the newer developers here.
Do you think you deserve a promotion or a raise in pay? Ask for it.
You can't expect anyone to advocate for you other than...you. I try to take care of my team, and reward those who are on the radar, but sometimes that falls through the cracks and I miss things.
I recently had a team member who felt they were being overlooked on promo/raise. That team member advocated for himself. They brought their concerns to me, we discussed, and now they are scheduled for promo and raise.
It doesn't hurt to ask. If you work at a company where asking can have negative consequences, then you are working at the wrong company and you need to move on.
Depends on the organization. Such practices in highly structured organizations where salary review is part of a set schedule can be considered stepping out of line or whishing to be treated with 'special' consideration over and above coworkers who operate within the bounds of policy.
Such organizations it would be better to keep your powder dry until such a review interval and then express a strong case advocating your position while remaining within the set parameters of policy.
And if they say 'no', then ask about what goals you can achieve that will change that.
Open a conversation about your career path in that organization.
Let them know you want advancement, otherwise you'll just be one of the worker-drones.
Just another cog in the wheel
Last Visit: 31-Dec-99 18:00 Last Update: 27-May-17 16:35