--
On Thursday, June 15, 2017 at 1:28:31 PM UTC-5, Bobby Garza wrote:I'm having a lot of trouble just getting my code to work with cuda. I know that Cuda works with my machine because I found some code on github that uses @cuda.jit and it runs fine. The error I keep receiving cannot type empty list, but I made sure all of my numpy arrays are populated and that they are numpy arrays and not python lists. Any help would be amazing!P.S. This is just a code snippet, so it won't run with a copy pastedef main():hash_for_y_axis()hash_nums()#fi = []#trying to encrypt Issac Asimov's short story, "The Last Question"#The code below puts each string as an input value in a listwith open("theLastQuestion.txt") as f:fi = ([word for line in f for word in line.split()])short_story = np.asarray(fi)for x in range(0, len(fi)):map_key(short_story[x]) #the call to map_key assigns ascii values to each character in the short story, preps dataencrypted_message_array = np.empty_like(iterate_list) #iterate is filled in map_keynp_array = np.asarray(iterate_list)#print(short_story) #contains the story in a numpy array#print(np_array) # contains the story in asciistream = cuda.stream()with stream.auto_synchronize():gpu_array = cuda.to_device(np_array, stream)run_encryption[32,32](gpu_array, encrypted_message_array) #i'm not sure about my griddim and blockdim values...gpu_array.copy_to_host(encrypted_message_array, stream)print(encrypted_message_array)#function takes an ascii value and an output array and returns the number of times it took to get in the range of x/256@cuda.jit("int32(int32, int32[:])", device = True)def run_encryption(y_coord_list, output_array):r = 3.8b = rand.uniform(0,1) #random initial conditionb_list.append(b)j = 0while(j < len(iterate_list)):for i in range(1,max_iterate):result = r * b * (1 - b)b = r * b * (1 - b)if check_range(result, y_coord_list[j]):output_array[j] = iprint(i)j = j + 1return output_array
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users+unsubscribe@continuum.io.
To post to this group, send email to numba...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/numba-users/0c9a1480-b5b0-4d29-b7a0-dfd52b548926%40continuum.io.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.