Problem with restriction specifier in C++ AMP code
Hi,
I'm using C++ AMP (I'm not that experienced with C++ and I'm new to AMP, so I have to stumble through this stuff) But I thought I had this code working, but now I'm getting the following error:
Error 1 error C3930: 'WRC_Raytracer::RaytracerRTC::RenderSceneWithAMP::<lambda_c13eb21eb34534d03d408733745bcf16>::operator ()' : no overloaded function has restriction specifiers that are compatible with the ambient
context 'Concurrency::_Parallel_for_impl'
Here is my parallel loop (cut down slightly to focus on the issue):
[code]
parallel_for(0, 720 * 576, 1, [w, cBuffer, pixelDataView](int i) restrict(amp)
// compute x and y for the given index
float x = (float)(i % w);
float y = (float)(i / w);
// convert color from {0,1}f to {0,255}b
int bInt, gInt, rInt;
bInt = (int) (min(x/719.f, 1) * 255);
gInt = (int) (min(y/575.f, 1) * 255);
rInt = (int) (min(0, 1) * 255);
// represent color data as (int)argb
int pixelAsInt = (255 << 24) + (rInt << 16) + (gInt << 8) + bInt;
// update pixelData element
pixelDataView[i] = pixelAsInt;
[/code]
Can anyone see what's wrong here ? As I said, I'm sure this was working yesterday, and I did something just before shutting down, and now it's not working.
The documentation for AMP mentions parallel_for_each:
http://msdn.microsoft.com/en-us/library/hh265136.aspx. Seems that you should redesign the code and use
parallel_for_each instead of parallel_for in case of restrict(amp).
Similar Messages
-
while installing adobe creative cloud , getting the following error msg " There seems to be a problem with the download process. Error code:201"
Creative Cloud Help / Error downloading Creative Cloud applications
http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html -
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2755.
Although you're getting a different error message, perhaps try the procedure from the following user tip:
"The administrator has set policies to prevent this installation" error messages when installing iTunes for Windows on Windows Vista and Windows 7 systems -
Hi,
I am getting error "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869." while installing SAP B1DE.
Note:
Downloaded the B1DE from B1DE:SAP Business One Development Environment Tools
Using Window XP , .Net 2008, SAP B1 8.81 Version
Company Name, Contact Person, Namespace all were given while installing. All of its length is less than 8
Any help is appreciated.
Thanks in advance.
Parvatha Solai.NHi,
Try post a comment in B1DE 2.0.1 new version! blog.
Beni. -
Compilation error with (amp) restriction specifier in C++ AMP
Hi,
[double post from :
original post ]
I'm using C++ AMP (I'm not that experienced with C++ and I'm new to AMP, so I have to stumble through this stuff) But I thought I had this code working, but now I'm getting the following error:
Error 1 error C3930: 'WRC_Raytracer::RaytracerRTC::RenderSceneWithAMP::<lambda_c13eb21eb34534d03d408733745bcf16>::operator ()' : no overloaded function has restriction specifiers that are compatible with the ambient
context 'Concurrency::_Parallel_for_impl'
Here is my parallel loop (cut down slightly to focus on the issue):
[code]
parallel_for(0, 720 * 576, 1, [w, cBuffer, pixelDataView](int i) restrict(amp)
// compute x and y for the given index
float x = (float)(i % w);
float y = (float)(i / w);
// convert color from {0,1}f to {0,255}b
int bInt, gInt, rInt;
bInt = (int) (min(x/719.f, 1) * 255);
gInt = (int) (min(y/575.f, 1) * 255);
rInt = (int) (min(0, 1) * 255);
// represent color data as (int)argb
int pixelAsInt = (255 << 24) + (rInt << 16) + (gInt << 8) + bInt;
// update pixelData element
pixelDataView[i] = pixelAsInt;
[/code]
Can anyone see what's wrong here ? As I said, I'm sure this was working yesterday, and I did something just before shutting down, and now it's not working.
Edit : I tried the parallel_for_each loop that I had started with. And that actually does work ...
parallel_for_each(pixelDataView.extent,[=](index<1> idx) restrict(amp)Hello Gavin, thank you for your question.
Note that parallel_for_each (more precisely, the overloads that accept extent arguments and take a restrict(amp) functional parameter) is the unique entry-point for C++ AMP execution. Other functions in the concurrency namespace, such as parallel_for,
are unrelated, and stem from a different technology (PPL). Since restrict(amp) is specific to C++ AMP, trying to use a restrict(amp) functional object in any context but that of C++ AMP execution, is not possible - hence the compiler error
you were seeing. Hopefully this turns out helpful for you. Also, congratulations for picking up C++ AMP, I hope you like it! Cheers! -
Problem with JTextArea or is it my code, Help!!!
Hi,
I am going crazy. I am sending a message to a JTextArea and I get some very wierd things happening? I really need help because this is driving me crazy. Please see the following code to see my annotations for the problems. Has anyone else experienced problems with this component?
Thanks,
Steve
// THIS IS THE CLASS THAT HANDLES ALL OF THE WORK
public class UpdateDataFields implements ActionListener { // 400
JTextArea msg;
JPanel frameForCardPane;
CardLayout cardPane;
TestQuestionPanel fromRadio;
public UpdateDataFields( JTextArea msgout ) { // 100
msg = msgout;
} // 100
public void actionPerformed(ActionEvent evt) { // 200
String command = evt.getActionCommand();
String reset = "Test of reset.";
try{
if (command.equals("TestMe")){ // 300
msg.append("\nSuccessful");
Interface.changeCards();
} // 300
catch(Exception e){
e.printStackTrace();
try{
if (command.equals("ButtonA")){ // 300
// WHEN I CALL BOTH OF THE FOLLOWING METHODS THE DISPLAY WORKS
// BUT THE CHANGECARDS METHOD DOES NOT WORK. WHEN I COMMENT OUT
// THE CALL TO THE DISPLAYMESSAGE METHOD THEN THE CHANGECARDS WORKS
// FINE. PLEASE THE INTERFACE CLASS NEXT.
Interface.changeCards();
Interface.displayMessage("test of xyz");
} // 300
catch(Exception e){
e.printStackTrace();
} // 200
} // 400
// END OF UPDATEDATAFIELS END END END
public class Interface extends JFrame { // 300
static JPanel frameForCardPane;
static CardLayout cardPane;
static JTextArea msgout;
TestQuestionPanel radio;
Interface () { // 100
super("This is a JFrame");
setSize(800, 400); // width, height
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// set-up card layout
cardPane = new CardLayout();
frameForCardPane = new JPanel(); // for CardLayout
frameForCardPane.setLayout(cardPane); // set the layout to cardPane = CardLayout
TestQuestionPanel cardOne = new TestQuestionPanel("ABC", "DEF", msgout, radio);
TestQuestionPanel cardTwo = new TestQuestionPanel("GHI", "JKL", msgout, radio);
frameForCardPane.add(cardOne, "first");
frameForCardPane.add(cardTwo, "second");
// end set-up card layout
// set-up main pane
// declare components
msgout = new JTextArea( 8, 40 );
ButtonPanel commandButtons = new ButtonPanel(msgout);
JPanel pane = new JPanel();
pane.setLayout(new GridLayout(2, 4, 5, 15)); pane.setBorder(BorderFactory.createEmptyBorder(30, 20, 10, 30));
pane.add(frameForCardPane);
pane.add( new JScrollPane(msgout));
pane.add(commandButtons);
msgout.append("Successful");
setContentPane(pane);
setVisible(true);
} // 100
// HERE ARE THE METHODS THAT SHOULD HANDLE THE UPDATING
static void changeCards() { // 200
cardPane.next(frameForCardPane);
System.out.println("Calling methods works!");
} // 200
static void displayMessage(String test) { // 200
String reset = "Test of reset.";
String passMessage = test;
cardPane.next(frameForCardPane);
System.out.println("Calling methods works!");
msgout.append("\n"+ test);
} // 200
} // 300Hi,
I instantiate it in this class. Does that change your opinion or the advice you gave me? Please help!
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class CardLayoutQuestionsv2 {
public static void main(String[] arguments) {
JFrame frame = new Interface();
frame.show();
} -
Problem with PnP devices, Unknown device, error code:28
Hello, my USB Mass Storage Device Not Recognized( Flash drive- HP v156w, 16 GB)
Full story : I opened flash disk, started to loading and opening files very slow, suddenly all writing, names of the files become unreadable. I took off the flash disk and try again. I got the message- disk have to be formated to be used
again. After a lot of try I got this message:
Unknown device doesn't have a driver ; and Problem with PnP devices when i run trouble shoot in devices and printers on my Sony VAIO laptop( Windows 8, 64 bit), and error code:28 for unknown device doesn't have a driver.
Do other usb devices work ok in the same usb port? - yes
Has someone else/or you used it on another pc?- yes
Does it work ok on a different pc? - the same problem
Did you pull it out with using 'Safely Remove Hardware'? - yes, a lot of time after its become invisible, unknoun
Was it previously working ok with your W8 laptop? - never tried befor
Disk Management can't see the drive.
device manager:
usb device with yellow sine and instead name strange sines
divice tipe - other devices
manufacturer - unknown
location- on USB Mass Storage Device
status: The drivers for this device are not installed. (Code 28)
To find a driver for this device, click Update Driver.
I have done that -
"open device manager make sure show hidden devices is ticked and right click on all the USB hidden devices and unistall them. once done reboot and put in the flash drive again and see if windows finds it."
situation the same(((( Disk Management can't see the drive.
please if any one know the fix please help
Its very important info for me on the flash disk.I'd ask them over here.
http://answers.microsoft.com/en-us/windows/forum/windows_8?tab=Threads
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights. -
Problem with the printer or ink system code 0x610000f6 HP model 6700 premium
Hello, I have recieved an alert for the second time in a week stating that there is a problem with the printer or ink system. The alert prompts me to turn off, then on the printer. If problem persists, contact HP. 0x610000f6. What could be the cause for this type of alert to appear?
'0x610000f6' error message appears if there is a 'Paper Jam' or a 'Carriage Jam' in the printer.
You can experience following issues:
The product won't print.
The print job stops unexpectedly.
To resolve Error code '0x610000f6' follow methods provided in below mentioned link
http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&docname=c01620497 -
I'm having problems installing Itines on my new computer with Windows 8. I always get problem with install. the error code is 2503. How do I correct this?
Although you're getting a different error message, perhaps try the procedure from the following user tip:
"The administrator has set policies to prevent this installation" error messages when installing iTunes for Windows on Windows Vista and Windows 7 systems -
Problems with export to PDF from C# code
I have problems export a Crystal report to pdf from code. Generating with database on accept is working as planned. But when I select production database (software on the same server) then I have problems with a few reports? The application just seem to hang on this line of code
myReport.ExportToDisk(ExportFormatType.PortableDocFormat, @"c:\temp\name.pdf");
Configuration Windows server standard with installed:
Crystal Report 2008 Runtime SP3
SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit)
SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit)
I also tried different formats (txt , excel) but the same problems.Hi David,
I hope this helps you: C# code to export to pdf using Crystal Report
David,this is not right place to discuss. please post this thread in this location:
SAP Crystal Reports, version for Visual Studio
Thanks,
DJ -
Problem with Restrict Access to Page with access level using ASP
I'm using Dreamweaver CS3 with ASP-VBScript and an Access
database. The pages were created from scratch for this project,
using those tools all the way through.
I've created a login page, an admin homepage, and add, edit,
and list records pages for three tables. The login page uses the
Server Behavior "Log in User", all other pages use the Server
Behavior "Restrict Access to Page". All of these are based on an
Access Level.
Login seems to work correctly, and redirects to the admin
homepage. From the admin homepage, I can open any other page as
expected, and they initially display correctly. On the add and edit
pages, however,
submitting the form often results in getting logged out, but
not always.
Once this happens, I can log back in, but other problems will
sometimes occur during that second login session. Sometimes,
logouts will occur on pages that worked fine during the first login
session. Sometimes, another session variable that I've setup
manually will change when it shouldn't...as if there were two
values stored for my session variable, and reloading the page
changes to the other value.
This
post seems closest to my experience, but it doesn't look like
there was really an answer beyond "I had to fight with it for a bit
to get it to work":
I suspected that there is some problem with session settings
on the server. We have an almost identical tool on the same server
that was developed with an older version of DW that works more
reliably; it sometimes has problems with the initial login, but
never has a problem after that.
Has anyone experienced problems like this? Any suggestions
for what to check? I'm really pulling my hair out since it's so
unreliable...the kind of problem that goes away when you try to
show someone and comes back when they leave.Hello,
I was thinking that all I would need would be the username, although username and paswsword would be more secure. There are about 50 users and no groups or levels. They are all equal ... same level.
The website is private and there is a general content area for all users and then there will be private areas for each user where proprietary documents will be held. I need to be able to ensure that user 'A' can only see the user 'A' pages, user 'B' can only see user 'B', etc.
I don't really understand what the Dreamweaver script is doing, but the overview sounded like it was the right tool to accomplish what I'm trying to do.
Any assistance greatly appreciated.
thanks. -
Problem with Restricted Key figure!
Hello BW Gurus,
Currently I am having problem with a report that is using a restricted key figure in the formula. When I filter down this restricted key figure, it is working fine but when I use this restricted key figure in formula that calculate greater than value, its giving me wrong figure and when I calculate less then value, its giving me zero total result. I am drilling down this restricted KF on a hierarchy. Did I miss any setting or do I need to do anything extra for this?
Please let me know and thanks in Advance,
Vaghar.In that case create two calculated keyfigures CKF1 and CKF2 such that
CKF1 = ((Count >100)*1 + 0)
CKF2 = (Count<100)*1 + 0)
and then define Greater Count as a formula such that
Greater Count = <b><i>Count</i></b> (CKF1)
and similarly Lesser Count = <b><i>Count</i></b> (CKF2).
where <b><i>Count</i></b> is a data function which gives a value of 1 when the operand <>0 and returns a 0 when the operand = 0.
Hope this helps. -
Problem with Restricted Recruiter Requisition Status Change Approval Proces
Hello,
Our company is having a problem with Recruiters recieving any approval notifications for requisitions where the status change is performed by someone logged on as a Restricted Recruiter. The approval notification never appears in the Recruiters approval page. The Restricted Recruiter is able to submit the request without any problems.
I was hoping that someone could help point me in the right direction so that I may begin troubleshooting this.
Thanks for your assistance.
RyanI have been doing some digging on this matter on E-Recruiting workflow and have discovered transaction SWI2_FREQ (Work Items per Task), very useful. Upon running this utility I found 8 pending approval request tasks. I double clicked on the task to show the workflow status of each task.
I double clicked on one of the request for status change tasks for a requisition which took me to the approval request for status change of Req ########. Here I clicked on the activities tab selected the activities tab, selected the activity Approval request for status change of Requisition ######## then clicked on the execute icon.
Doing this opened up a new web browser and prompted me to login. Using the correct login credentials for this environment I click the login button and promptly recieve the error message...
Error in Web service execution
E:SWF_HTTP:050 TS51807979
At this point I am unsure of where to go...
Any help would be appreciated.
Ryan -
I am running Windows 7 64bit. I downloaded the latest version of iTunes and ran the installer. This message pops up, I click OK and the installation continues. Then, when I try to launch iTunes I get this: "iTunes was not installed correctly. Please reinstall iTunes. Error 7 (Windows error 5)". I have also received this error message even when the installation hasn't had any problems. I have uninstalled, reinstalled, restarted, repaired my .net framework, uninstalled all components following the steps in Article: HT1923 http://support.apple.com/kb/HT1923 all to no avail. It still won't run. It was working perfectly before I updated it to 10.7. After that it all went to crap. I even tried installing the previous version and still get this error message. Any suggestions?
Okay ... so it's not one of the cases of bodged up ACLs on the Apple folder in Common Files. (That's been underlying a few of the recalcitrant E7W5s.
Just in case, let's try the fixit from the following document:
Fix problems with programs that can't be installed or uninstalled -
Problem with PDF files opening up in code on IMac OS 10.6.6
Just bought a new IMac three weeks ago (my first Apple Computer after years of using a PC). I've been using their TextEdit program to create simple documents, and routinely save the documents as PDF's to make it easier to share with clients. Everything has worked fine until three days ago - now whenever I open a PDF file it shows up in code. This is happening to documents I created several weeks ago, it is happening to new documents I am creating, and it is happening to PDF files clients are sending to me. (For instance, today I received a PDF file attached to an email from a client - if I hit "quick look" I can view the document with no problem, but if I hit save, or double click the document in order to print, the document shows up in code (and prints in code). Eek! I just spent over an hour with Apple support trying to figure out a solution, but they ended up just as baffled as me, and directed me to call Adobe. Hoping someone can help me figure out what I need to do to resolve this. Thank you!
Thank you George for your response to my plea for help. Late yesterday I was able to get in touch with a friend familiar with Mac and PC and she figured out my main problem was trying to use TextEdit as a primary document program. (She also had me try to open some PDF files with preview, but they still came up as code.) She quickly realized I would be able to open these files in my documents file - I was trying to open them up in the TextEdit program. Anyway, the main thing I'm realizing is I need to get Microsoft Office to avoid these challenges in the future. As you can tell, I'm not up to speed on computer stuff, but my friend said the Apple support guy should have realized right away that using TextEdit the way I was attempting to use it was my real problem, not an issue with Adobe Reader.
Thanks again!
Maybe you are looking for
-
Inserting multiple records into a database from a table
I have a dynamic table with rows upto 10. i am trying to insert all the records in these rows into a database ( msaccess) table name: Table1 ( in my form ) Database table : movies_comments ( as posted in stefan's forums ). table columns: username, mo
-
Performance in XI / PI ABAP mapping class
Hi, I have to do some ABAP mapping for XI / PI scenarios. First of all number of messages is huge, messages can be very large, so my question is where to pay special attention because of performance. Is there some blog on net with suggestions? I saw
-
Invalid directory structure in Log and Transfer w/ AVCHD & stills
Using FCE 4.01 I have been happily using Log & Transfer for material from Panasonic AG-HMC70P AVCHD Camera. Last night I shot some material using an SD card that had some still photo files on it from a Nikon Coolpix. Now FCE won't read the SD card fo
-
How do you get Siri to read your text
I can't seem to get SIRI to read my text aloud...it's silent for a few seconds, then it asks if I want it to read it again??
-
The black "show shadow clipping" indicator not extinguishable. . What can be done? I tried the obvious. There is no evidence of clipping. Lightroom version: 5.6 [974614] License type: Perpetual Operating system: Windows 7 Ultimate Edition Version: