Code Monkey home page Code Monkey logo

Comments (5)

Horkyze avatar Horkyze commented on May 24, 2024

Hi, of course you can!

Notice this line:

jobs[i] = JOB_init(buff, temp, argv[index]);

buff stands for buffer and it's nothing else then a string. So you can pass in whatever you want.
If you dont know how to read input from stdin, I suggest you google that, there are a lot of good tutorials out there.

from cudasha256.

merclyn avatar merclyn commented on May 24, 2024

I thought I tried that earlier, ill try it again.
In your code, if I passed in the variable line in place of buff, should I replace temp with strlen(line)? this is what I thought I did. Once I have it working with a string, I can easily get stdin working. Ill give it a shot later in the day.

Again, Thanks for the help.

from cudasha256.

merclyn avatar merclyn commented on May 24, 2024

Im real close, but still cigar.

I added these 3 lines directly above the line 194 you refer to above:
buff = (BYTE *)"Hello";
checkCudaErrors(cudaMallocManaged(&buff, (5)*sizeof(char)));
jobs[i] = JOB_init(buff, 5, argv[index]);
and I get this hash:
8855508aade16ec573d21e6a485dfd0a7624085c1a14b5ecdd6485de0c6839a4 file.1
but I believe the hash is incorrect, because I compare it to:
$ echo -n "Hello" | sha256sum
and I get:
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969 -

I would expect the hash from both of those to match exactly.

BTW: If I dont cast buff to (BYTE *) then I get a compile error. Once I have this working with a simple string, ill be able to take it from there.

from cudasha256.

merclyn avatar merclyn commented on May 24, 2024

I have some progress. I seem to need to better understand variable pointers in c++.

from cudasha256.

Fyzjym avatar Fyzjym commented on May 24, 2024

Hello, may I ask for your help?

After I modify the code, I get an incorrect hash value.

			buff = (BYTE *)"abc";
			checkCudaErrors(cudaMallocManaged(&buff, (3)*sizeof(char)));
			jobs[i] = JOB_init(buff, 3, argv[index]);

from cudasha256.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.