Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mapSlice and fix Issue 16501 #4781

Merged
merged 2 commits into from
Sep 28, 2016
Merged

add mapSlice and fix Issue 16501 #4781

merged 2 commits into from
Sep 28, 2016

Conversation

9il
Copy link
Member

@9il 9il commented Sep 14, 2016

This is part of #4652. ndMap was renamed to mapSlice, it is correct, because we already have this iotaSlice, indexSlice, and repeatSlice. Other ndXXX algorithms are not part of this PR.
Additional changes:

  1. Issue 16501 fixed
  2. Some private / package / undocumented stuff from .slice now public and moved to .internal. This is done to allow Mir to remove already accepted modules from its code base.
  3. Pack and Map in internal is stuff that is new (but already reviewed in ndslice.algorithm #4652).

The last commit also fix issue 16503.

@9il 9il added the ndslice label Sep 14, 2016
@codecov-io
Copy link

codecov-io commented Sep 14, 2016

Current coverage is 88.88% (diff: 92.47%)

Merging #4781 into master will increase coverage by 0.34%

@@             master      #4781   diff @@
==========================================
  Files           124        121      -3   
  Lines         77343      74329   -3014   
  Methods           0          0           
  Messages          0          0           
  Branches          0          0           
==========================================
- Hits          68485      66070   -2415   
+ Misses         8858       8259    -599   
  Partials          0          0           

Powered by Codecov. Last update 2ccfbcc...9efc78e

@9il 9il force-pushed the mapSlice branch 2 times, most recently from 5191c2e to 648c25f Compare September 14, 2016 11:04
@9il 9il added this to the 2.072.0 milestone Sep 14, 2016
@9il 9il mentioned this pull request Sep 14, 2016
14 tasks
@schuetzm
Copy link
Contributor

Seems you accidentally added internal.o...

@9il
Copy link
Member Author

9il commented Sep 14, 2016

Seems you accidentally added internal.o...

Thanks!

@9il 9il force-pushed the mapSlice branch 3 times, most recently from 7f0d1e5 to 9efc78e Compare September 16, 2016 23:23
@dlang-bot
Copy link
Contributor

dlang-bot commented Sep 16, 2016

Fix Bugzilla Description
16501 packed ndslices does not compile
16503 [ndslice] prevents fastmath LDC attribute

@9il 9il changed the title add mapSlice add mapSlice and fix Issue 16501 Sep 16, 2016
@9il 9il added the Bug Fix label Sep 16, 2016
auto opBinary(string op)(sizediff_t shift)
if (op == `+` || op == `-`)
{
auto ret = this;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was auto ret = this.ptrs;.
This is fix for 16501. Unittest can be found below

@9il 9il force-pushed the mapSlice branch 3 times, most recently from e6f8290 to c8fb4fa Compare September 17, 2016 01:23
@9il
Copy link
Member Author

9il commented Sep 19, 2016

@DmitryOlshansky could you please review / merge this PR? It is split into 2 commits.

@9il 9il force-pushed the mapSlice branch 2 times, most recently from 89a899f to 9d6b9a5 Compare September 20, 2016 19:48
version(LDC)
{
static import ldc.attributes;
alias fastmath = ldc.attributes.fastmath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might be a bit careful with this as LDC 1.1 isn't officially released.
@klickverbot is it common to compile a newer Phobos release with an older / stable LDC version?

Copy link
Member Author

@9il 9il Sep 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Phobos is merged with DMD FE

Copy link
Member Author

@9il 9il Sep 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Furthermore, it is not possible for many releases because new Phobos additions depend on new language, druntime or DMD FE changes.

@9il
Copy link
Member Author

9il commented Sep 25, 2016

@wilzbach maybe you can review / merge this please?

@andralex andralex merged commit a5e9353 into dlang:master Sep 28, 2016
@9il
Copy link
Member Author

9il commented Sep 29, 2016

Thanks!

@9il 9il deleted the mapSlice branch September 29, 2016 05:06
}

enum FastmathDummy { init }
FastmathDummy fastmathDummy() { return FastmathDummy.init; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps nitpicks but:

  1. Can't FastmathDummy, fastmathDummy and alias fastmath be replaced with just enum fastmath;
  2. If fmb is declared as package should these dummy symbols be that as well, or even private?
  3. BTW, shouldn't all public symbols be package in this module, since it's an internal module?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't FastmathDummy, fastmathDummy and alias fastmath be replaced with just enum fastmath;

I am not sure

If fmb is declared as package should these dummy symbols be that as well, or even private?

No

BTW, shouldn't all public symbols be package in this module, since it's an internal module?

No, this module is public because we need 1. Remove existing ndslice modules from Mir. 2. Have additional ndslice modules in Mir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants