GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added `get_revision` and `device_info` by botev · Pull Request #107 · arrayfire/arrayfire-rust

Conversation

@botev

@botev botev commented Feb 17, 2017

Copy link
Copy Markdown
Contributor

Sorry, this should have been part of the previous, but was a bit busy.
One caveat is that I assumed that the commit string is truly static, so I return Cow<'static, str>. Also, I notice that the name of the platform has underscores Intel(R)_Core(TM)_i7-4600U_CPU_@ 2.10GHz so the question is should those be replaced by spaces or kept like that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@botev
Added get_revision and device_info
4fef41e
@botev
botev force-pushed the devel branch from ee93320 to 4fef41e Compare February 17, 2017 12:55
@9prady9

9prady9 commented Feb 19, 2017

Copy link
Copy Markdown
Member

@botev Commit string is a compile time string and the user should not free it. What does Cow<> do when a variable of such type goes out of scope ?

@pavanky Why does the platform name returned by af_device_info has underscores?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pavanky

pavanky commented Feb 19, 2017

Copy link
Copy Markdown
Member

@9prady9

@pavanky Why does the platform name returned by af_device_info has underscores?

I don't know what you mean. Can you show me an example ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@9prady9

9prady9 commented Feb 19, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@pavanky

Name: GeForce_GT_650M

Thats the output of af_devie_info for platform name, white spaces are replaced by underscores.

Edit:
You can also find it in the PR description for Intel CPU.

We are doing that at this line in the upstream.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pavanky

pavanky commented Feb 19, 2017

Copy link
Copy Markdown
Member

@9prady9 That is not platform name, that is device name. I don't remember why I changed spaces to underscores. If we are going to change this, it should probably change upstream.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@9prady9

9prady9 commented Feb 19, 2017

Copy link
Copy Markdown
Member

Okay. @botev No need to change underscores to white spaces.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@botev

botev commented Feb 19, 2017

Copy link
Copy Markdown
Contributor Author

@9prady9 Cow is a clone-on-write smart pointer. Additionally, it relies on a reference. This means:

  1. It does not free anything underlying (as in rust references require that the owner outlives them, but they do not free resources).
  2. If someone decides to modify it in any way it clones the underlying object. E.g. if someone decides to use the returned value in building a new string it will clone it so that it does not modify the initial underlying string.

I think that is good consistent behavior and has 0 overhead at runtime (I think the modification checks are at compile time).

9prady9 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@9prady9
9prady9 merged commit 3f58888 into arrayfire:devel Feb 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@botev @9prady9 @pavanky
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.