hkaiser changed the topic of #ste||ar to: STE||AR: Systems Technology, Emergent Parallelism, and Algorithm Research | stellar-group.org | HPX: A cure for performance impaired parallel applications | github.com/STEllAR-GROUP/hpx | This channel is logged: irclog.cct.lsu.edu
diehlpk_work has quit [Ping timeout: 240 seconds]
K-ballo has quit [Quit: K-ballo]
hkaiser has quit [Quit: Bye!]
<ms[m]> srinivasyadav227: you might also want to check the email above since your PRs are affected
<gonidelis[m]> ms: thanks
<gonidelis[m]> i need to subscribe with my new email to the list
<gonidelis[m]> ms: now in case I wanna tweak the source local code by using just hpx is that possible?
<ms[m]> gonidelis: instead of letting hpx download hpxlocal you can also point it to a source tree with FETCHCONTENT_SOURCE_DIR_HPXLOCAL or to an installed hpxlocal with the usual cmake mechanisms
<ms[m]> in your case I guess you rarely use the distributed stuff so you might also just want to use hpxlocal on its own
K-ballo has joined #ste||ar
hkaiser has joined #ste||ar
diehlpk_work has joined #ste||ar
<gonidelis[m]> why the heck compiler explorer hits me here ? https://godbolt.org/z/KKz66T7a6
<gonidelis[m]> seems absurd
<gonidelis[m]> (lol no main)
<gonidelis[m]> i need coffee sorry
<zao> This isn't modern C# ;)
<gonidelis[m]> hahha
<gonidelis[m]> K-ballo: is it really bad to typecast from a pointer type to another pointer type except for these situations ? https://en.cppreference.com/w/cpp/language/reinterpret_cast#Type_aliasing
<gonidelis[m]> is `int* pa = a; float* pb = (float *)pa;` supposed to be undefined behavior?
<gonidelis[m]> caues i don't see float and int falling into any of those exception categories
<hkaiser> well, think about what that means
<hkaiser> sketch what this looks like in memory
<gonidelis[m]> `pb` holds twice as much memory?
<hkaiser> no
<hkaiser> *pb might have a different size
<hkaiser> on some systems sizeof(int) == sizeof(float) on some not
<gnikunj[m]> The only cool casts are from T* to void* and back. C FTW xD
<hkaiser> and even if they have the same size, what sense does it make to reinterpret a bit pattern that is representing an int as if it was representing a float?
<hkaiser> elements of programming chapter 1, I believe
<gonidelis[m]> hkaiser: well sure. i don't want to apply this typecast somewhere, but it's good to know that i shouldn't not apply it in the future
<gonidelis[m]> but what does eop ch1 have to do with that?
<gonidelis[m]> gnikunj: yeah...pure memory address although i still dont know why
<K-ballo> casts are fine most of the time, dereferencing the resulting pointer is another story
<K-ballo> *inter-pointer casts
<gonidelis[m]> K-ballo: lol
<gonidelis[m]> i get that the float* size might be different than the int* size but what implications could it have at the end?
<gonidelis[m]> how could misalignment actually happen?
<hkaiser> gonidelis[m]: no, usually sizeof(float*) == sizeof(int*) as both are addresses in memory
<hkaiser> however sizeof(float) is not always equal to sizeof(int)
<hkaiser> gonidelis[m]: different types might have different alignment requirements, e.g. char is usually byte-aligned, while double could be aligned to addresses divisible by 8
<gonidelis[m]> oh!
<hkaiser> gonidelis[m]: for instance an operation on a double located on the stack that is not aligned at boundaries divisible by 8 will cause a segmentation fault on x86
<gonidelis[m]> what do you mean "aligned to address" ?
<gonidelis[m]> placed?
<hkaiser> the address has to be divisible by 8
<hkaiser> i.e. values 0, 8, 16, etc
<hkaiser> ms[m]: would you have any suggestion how we can ensure that PRs on hpx that depend on changes in hpx-local can be properly tested?
<gonidelis[m]> yes but what do you mean the data is aligned to some address?
<hkaiser> that the address of that data items is divisible by some integer value, usually 2, 4, 8 or 16
<gonidelis[m]> ok ok ok got it
<ms[m]> hkaiser: if hpx really depends on those changes in hpx-local that dependency should be reflected in the minimum version required and the default tag used for hpx-local
<hkaiser> for each PR?
<ms[m]> until the next release I've started tagging hpx-local with tags like this: https://github.com/STEllAR-GROUP/hpx-local/tree/hpx-local-pre-release-1
<ms[m]> which we can bump as needed
<hkaiser> so we'll always have to wait for the changes to hpx-local to go through before we even start testing the PR itself?
<ms[m]> yes, though you can of course test with it locally and/or set the tag/branch in CI as well
<hkaiser> so much for 'the split will not impact the development of hpx'...
<hkaiser> as predicted, btw
<gonidelis[m]> i was thinking whether i avoid copying by putting the `&` over there since i am already passing the vector as`const ref`
<gonidelis[m]> assembly does not seem to change at all when i add/remove the ambersant, so it seems like copying is avoided in the first place?
<gonidelis[m]> ah seems like it's being copyied to `eax` w/o the `&`
K-ballo has quit [Quit: K-ballo]
<hkaiser> gonidelis[m]: without the const& it calls the copy constructor
<gonidelis[m]> i am talking without the `&` next to `i`
K-ballo has joined #ste||ar
<hkaiser> ahh
<hkaiser> sure, auto i - stores the integer, auto& i stores the reference to an element in the vector
<gonidelis[m]> sounds like no saving of cose
<gonidelis[m]> cost*
<hkaiser> why
<gonidelis[m]> both store sth
<hkaiser> the first has the integer, the second requires one more indirection as it uses a reference
<hkaiser> depends on how ofeten i will be used inside the loop
<hkaiser> if it's used once, then both are equivalent indeed
<gonidelis[m]> huh okk
<gonidelis[m]> got it
<hkaiser> just the indirection happens in different spots
<gonidelis[m]> how the heck do i properly convert a ulong to uint8_t?
<gonidelis[m]> if i know that ulong can fit into the uint8?
<K-ballo> static_cast
<K-ballo> you get an implicit conversion otherwise, which is "proper" but may warn
<gonidelis[m]> K-ballo: static_cast<uint8_t> gives me a proper uint?
<gonidelis[m]> uint8 *
<K-ballo> ?
<gonidelis[m]> i wanna use it in a bitset initialization
<gonidelis[m]> std::bitset<16> bs{static_cast<uint8_t>(my_ulong);
<gonidelis[m]> }
<K-ballo> that's odd, why would you be doing that?
<K-ballo> bitset has a constructor from unsigned long long (and none from uint8_t)
<gonidelis[m]> i know
<K-ballo> what are you actually trying to do?
<gonidelis[m]> but i want to convert my bitset to uint8_t
<K-ballo> are you saying `my_ulong` is a `std::bitset` then?
<gonidelis[m]> can be converted
<gonidelis[m]> the thing is that i want to map my bitset on a uint8_t
<K-ballo> that doesn't relate to bitset initialization at all then..
<K-ballo> it's unclear what you are trying to do, maybe put it down in code?
diehlpk_work has quit [Remote host closed the connection]